make_pipeline()

noun

say it: “MAYK PYP-lyn” /ˈmeɪk ˈpaɪpˌlaɪn/

A scikit-learn function that builds a pipeline from a list of steps, naming each step automatically.

What does make_pipeline() do?

make_pipeline() is scikit-learn's shortcut for building a Pipeline: you pass the steps alone, and it names each one after its class in lowercase, such as standardscaler. Those names are what you use to reach a step or set its options later.

from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
model = make_pipeline(StandardScaler(), LogisticRegression())
print(list(model.named_steps))   # ['standardscaler', 'logisticregression']

In a sentence

  • “She switched to make_pipeline() so she didn't have to name each step.”
  • “make_pipeline() named the steps standardscaler and logisticregression.”

Level: Journeyman · More Python terms at this level

Updated