Only Few Seats Left for Advanced Certification Courses on Data Science, ML & AI by E&ICT Academy IIT Roorkee
Apply NowNow 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 >>)
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...