Skip to content

Instantly share code, notes, and snippets.

@braz
Last active February 27, 2019 10:56
Show Gist options
  • Save braz/cf37a7870ef5aca072c622cdf0331fb1 to your computer and use it in GitHub Desktop.
Save braz/cf37a7870ef5aca072c622cdf0331fb1 to your computer and use it in GitHub Desktop.
Example of kFold (10) for training and for test data
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