Complete the code to import the Pipeline class from scikit-learn.
from sklearn.pipeline import [1]
The correct class name is Pipeline with a capital P.
Complete the code to create a Pipeline with a scaler and a logistic regression model.
pipeline = Pipeline(steps=[('scaler', [1]()), ('model', LogisticRegression())])
The correct scaler class is StandardScaler from scikit-learn.
Fix the error in the code to fit the pipeline on training data X_train and y_train.
pipeline.[1](X_train, y_train)The method to train the pipeline is fit.
Fill both blanks to create a pipeline that first applies PCA and then a classifier.
pipeline = Pipeline(steps=[('pca', [1](n_components=2)), ('clf', [2]())])
The first step is PCA for dimensionality reduction, and the second is RandomForestClassifier as the model.
Fill all three blanks to create a pipeline that scales data, reduces dimensions, and classifies.
pipeline = Pipeline(steps=[('scale', [1]()), ('reduce', [2](n_components=3)), ('classify', [3]())])
The pipeline first scales data with StandardScaler, then reduces dimensions with PCA, and finally classifies with LogisticRegression.