Last active
February 27, 2019 10:56
-
-
Save braz/cf37a7870ef5aca072c622cdf0331fb1 to your computer and use it in GitHub Desktop.
Example of kFold (10) for training and for test data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.model_selection import KFold | |
X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
kf = KFold(n_splits=10) | |
for train, test in kf.split(X): | |
print("%s %s" % (train, test)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment