A Pipeline step is named classifier. How do you search its C parameter without moving the estimator out of the pipeline?
Classic MLLevel: FoundationNested hyperparameters
A Pipeline step is named classifier. How do you search its C parameter without moving the estimator out of the pipeline?
Hints
- The step name is part of the parameter path.
- There is a nested-parameter separator.
Answer
Use classifier__C in the parameter grid. The double underscore addresses a nested estimator parameter, preserving the full preprocessing workflow during selection.
Source and licence: scikit-learn 1.7.2 — compose · BSD-3-Clause · answer: Quantoros editorial