scikit-learn / scikit-learn/scikit-learn

Can't instantiate pipeline with placeholder to search in GridSearchCV

Open
#12,335 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module:pipeline
Dominant language
Python
Stars
67.3k
Forks
27.4k
Avg merge
1d 15h
Merged PRs (30d)
58

Description

A cosmetic complaint:
It's not possible to instantiate a pipeline with a placeholder like in #12272 and grid-search the final estimator. If the final estimator is None, there is no score method and so GridSearchCV refuses to run.
I'm not sure if this is worth fixing or how to most elegantly fix it, but it's a bit ugly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Pipeline and GridSearchCV implementations and reproduce the failure with a None final estimator and a parameter grid. Define the intended placeholder behavior, then add regression coverage showing that GridSearchCV can search the final estimator without requiring a score method prematurely.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.