Skip to content
Quantoros

Several search candidates return NaN scores. How do you reveal the actual fit error instead of silently ranking them?

Classic MLLevel: IntermediateCandidate fitting failures

Several search candidates return NaN scores. How do you reveal the actual fit error instead of silently ranking them?

Hints
  • NaN can mean failed fitting, not poor predictive quality.
  • Turn failure recording into an exception.

Answer

Reproduce with error_score='raise' to surface the underlying exception. Check invalid parameter combinations, data requirements and memory limits before excluding candidates.

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

Related questions