1

When I run

cross_val_predict(a_clf, X_train, y_train, cv=5)

I get a single 1d array out of it:

array([False, False,  True, ..., False, False, False])

Shouldn't there be an array of predictions per fold?

Similar to

cross_val_score(a_clf, X_train, y_train, cv=5)

returning 5 items array. One score per each fold.

Kocur4d
  • 6,701
  • 8
  • 35
  • 53

1 Answers1

2

cross_val_predict does ouf-of-fold predictions for the complete dataset that you are interested in. Your dataset is split into k folds, the model is trained on k-1 folds and predictions for the hold-out hold is produced and stored for the output. See this answer on SO for more details.

Mischa Lisovyi
  • 3,207
  • 18
  • 29