Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left

  Apply Now

Project - Predicting Titanic Passenger Survival using Machine Learning and Python

14 / 21

Titanic Machine Learning Project - Join both the Pipelines

Now let's join the numerical and categorical pipelines.

INSTRUCTIONS

Join the two pipeline and save it in a variable named preprocess_pipeline:

from sklearn.pipeline import FeatureUnion
<< your code goes here >> = FeatureUnion(transformer_list=[
        ("num_pipeline", num_pipeline),
        ("cat_pipeline", cat_pipeline),
    ])

Fit the training data in this pipeline:

X_train = preprocess_pipeline.fit_transform(<< your code goes here >>)

Save the labels in y_train:

<< your code goes here >> = train_data["Survived"]
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...