Xgboost CV with python custom folds

I am working with data, where each patient can have a different number of training examples. When doing Xgboost CV, I want to make sure that data from the same patient is limited to only one crease, so I need to use creases, which can have a different number of indices.

At the moment of passing a list of numpy arrays containing indices using the 'fold' parameter in the xgb.cv function, I get:

dtrain = dall.slice (np.concatenate ([idset [i] for i in range (nfold) if k! = i])) ValueError: null arrays cannot be concatenated

I followed the same procedure in R without issue, passing my custom pivots as a list, where each item is a vector of test fold indices.

Could you please advise on how to properly pass custom indexes to the Python XGBoost CVG function. Thank!

+3
python xgboost cross-validation


source to share


No one has answered this question yet

Check out similar questions:

5504
Does Python have a ternary conditional operator?
5231
What are metaclasses in Python?
4473
Calling an external command in Python
3790
How can I safely create a subdirectory?
3602
Does Python have a substring method "contains"?
3119
What is the difference between Python list methods that are appended and expanded?
2818
Finding the index of an element by specifying the list that contains it in Python
2601
How can I make a time delay in Python?
2568
How to find the current time in Python
1
How to use custom addition cross validation with XGBoost



All Articles
Loading...
X
Show
Funny
Dev
Pics