1. Home
  2. Data Science
  3. Scikit-learn
  4. make_pipeline(StandardScaler(), LogisticRegression()) is…

Added 30 Nov -0001

make_pipeline(StandardScaler(), LogisticRegression()) is built. What keys does named_steps expose?

  1. step1 and step2, numbered in order
  2. scaler and clf, fixed default aliases
  3. It raises an error, because make_pipeline requires explicit names
  4. standardscaler and logisticregression, the lowercased class names Correct answer

Correct answer

D. standardscaler and logisticregression, the lowercased class names

19 views

MCQSEXAM

Explanation

make_pipeline generates names automatically by lowercasing each estimator's class name, which is why grid search keys look like logisticregression__C. Pipeline, by contrast, requires an explicit list of name and estimator tuples, and duplicate automatic names would collide. Use set_params with the double-underscore syntax to reach nested parameters.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs