Skip to content
Quantoros

How can a search respect a supplied validation set instead of inventing new folds?

Classic MLLevel: IntermediateFixed validation protocol

How can a search respect a supplied validation set instead of inventing new folds?

Hints
  • Encode fold membership explicitly.
  • Some rows should never enter validation.

Answer

Use PredefinedSplit: assign the validation rows a test-fold identifier and training-only rows -1. This reproduces the supplied split while retaining the search interface.

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

Related questions