When feeding test and train data into a ROC curve plot, I receive the following error:
KeyError: \"None of [Int64Index([ 0, 1, 2
in this piece of code train, test
are arrays of indices, while you using it as a columns when selection from DataFrame:
for train, test in kf.split(X, Y):
probas_ = model.fit(X[train], Y[train]).predict_proba(X[test])
you should use iloc
instead:
probas_ = model.fit(X.iloc[train], Y.iloc[train]).predict_proba(X.iloc[test])