I do not understand why do I get the error KeyError: '[ 1351 1352 1353 ... 13500 13501 13502] not in index'
when I run this code:
cv = KFold(n_splits=10)
for train_index, test_index in cv.split(X):
f_train_X, f_valid_X = X[train_index], X[test_index]
f_train_y, f_valid_y = y[train_index], y[test_index]
I use X
(a Pandas dataframe) to split I cv.split(X)
.
X.shape
y.shape
Out: (13503, 17)
Out: (13503,)