Project - Predicting Titanic Passenger Survival using Machine Learning and Python

You are currently auditing this course.
11 / 21

Titanic Machine Learning Project - Create Pipeline for the Numerical Attributes

Let's build the pipeline for the numerical attributes:

INSTRUCTIONS

Create the pipeline and save it in a variable named num_pipeline:

from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer

<< your code goes here >> = Pipeline([
        ("select_numeric", DataFrameSelector(["Age", "SibSp", "Parch", "Fare"])),
        ("imputer", SimpleImputer(strategy="median")),
    ])

Now fit the training data in this pipeline:

num_pipeline.fit_transform(<< your code goes here >>)
Get Hint See Answer

Loading comments...