Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow arbitrary cross validation fold indices #3353

Merged
merged 2 commits into from
Jun 30, 2018

Conversation

owlas
Copy link
Contributor

@owlas owlas commented Jun 1, 2018

  • use training indices passed to folds parameter in training.cv
  • update doc string

xgboost cv allows user to pass scikitlearn split objects or pass a list of indices for each fold. Indices are of the form:

[ (fold_1_train_idx, fold_1_test_idx), (fold_2_train_idx, fold_2_test_idx) ]

The current implementation uses the test indices to form dtest and forms dtrain from all indices that are not in the test indices.

An improvement would be to use the passed train indices explicitly (i.e. form dtrain from the train indices). This allows completely arbitrary cross validation strategies.

@owlas owlas force-pushed the train-test-indices branch 3 times, most recently from 2a1792f to 8473b5b Compare June 1, 2018 16:05
 - use training indices passed to `folds` parameter in `training.cv`
 - update doc string
@owlas owlas force-pushed the train-test-indices branch 2 times, most recently from 2b87e24 to 8a1a98c Compare June 4, 2018 13:02
@hcho3 hcho3 merged commit 18813a2 into dmlc:master Jun 30, 2018
CodingCat pushed a commit to CodingCat/xgboost that referenced this pull request Jul 26, 2018
* allow arbitrary cross validation fold indices

 - use training indices passed to `folds` parameter in `training.cv`
 - update doc string

* add tests for arbitrary fold indices
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants