Navigation Menu

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

Fixed #1654: Fix mknfold using new StratifiedKFold API #1660

Merged
merged 1 commit into from Oct 12, 2016

Conversation

terrytangyuan
Copy link
Member

@terrytangyuan
Copy link
Member Author

Java flaky test: https://travis-ci.org/dmlc/xgboost/jobs/167141727
@CodingCat Could you take a look?

@tqchen tqchen merged commit 63829d6 into dmlc:master Oct 12, 2016
@tqchen
Copy link
Member

tqchen commented Oct 12, 2016

I am going to merge this in one. wait @CodingCat to fix the java testcase

@CodingCat
Copy link
Member

Hmmm....this has appeared for multiple times,

I will deprecate this test temporarily and figure out the reason later

@jokari69
Copy link
Contributor

this commit makes it impossible to pass K Fold as an nfold argument (see comment in code). Please revert or add possibility to not shuffle (PR #1459)

@terrytangyuan
Copy link
Member Author

Could you elaborate? I don't fully understand. There's no comment in the code either

@jokari69
Copy link
Contributor

jokari69 commented Nov 24, 2016

line 235 you added the check to see if the folds are an instance of list.
My end goal is that i don't want to shuffle my data so that is why i made the previous PR. My current work around was to pass in a KFold on which i set shuffle=False but this doesn't work anymore now.
My data is not iid and shuffling might create data leakage.

@@ -232,14 +232,12 @@ def mknfold(dall, nfold, param, seed, evals=(), fpreproc=None, stratified=False,
randidx = np.random.permutation(dall.num_row())
kstep = int(len(randidx) / nfold)
idset = [randidx[(i * kstep): min(len(randidx), (i + 1) * kstep)] for i in range(nfold)]
elif folds is not None:
elif folds is not None and isinstance(folds, list):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check blocks off KFold usage

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented on your PR. Could you address this in your PR too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thanks for the quick reply

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 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.

None yet

4 participants