Login using Social Account
     Continue with GoogleLogin using your credentials
Now let us build the pipeline for the categorical attributes:
Import OneHotEncoder from sklearn.preprocessing
from << your code goes here >> import OneHotEncoder
Now save the pipeline we create for categorical attributes in a variable named cat_pipeline:
<< your code goes here >> = Pipeline([
        ("select_cat", DataFrameSelector(["Pclass", "Sex", "Embarked"])),
        ("imputer", MostFrequentImputer()),
        ("cat_encoder", OneHotEncoder(sparse=False)),
    ])
Now fit the training data into this pipeline:
cat_pipeline.fit_transform(<< your code goes here >>)
 
            Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...