scikit-learn: Pipeline

Chain preprocessing and a model into one estimator

35 min · interactive lesson with runnable code and 5 graded exercises.

What you'll be able to do

  • Explain what pipe.fit and pipe.predict do step by step
  • Show why a pipeline prevents leakage inside cross-validation
  • Inspect steps with named_steps and tune with step__param
  • Save and load one fitted object for serving

The full lesson is free with an account.

A pipeline is an estimator

Why it beats manual steps

named_steps and step__param

Saving the fitted pipeline

Pipelines in pipelines