Skip to content
Quantoros

Why is RepeatedKFold not a valid direct splitter for crossvalpredict?

Classic MLLevel: IntermediateOne prediction per row

Why is RepeatedKFold not a valid direct splitter for cross_val_predict?

Hints
  • Check the output's one-row/one-prediction contract.
  • Repetition changes prediction multiplicity.

Answer

cross_val_predict requires each sample to appear in a test fold exactly once. RepeatedKFold produces several held-out predictions per row, so aggregation must be implemented explicitly.

Source and licence: scikit-learn 1.7.2 — cross validation · BSD-3-Clause · answer: Quantoros editorial

Related questions