Sectie 1. Hoofdstuk 20
single
Challenge: Creating a Pipeline
Veeg om het menu te tonen
Use the original penguins.csv: first remove the two rows with insufficient data. Build one preprocessing pipeline that performs encoding, imputing, and scaling.
Only 'sex' and 'island' should be encoded, so use a ColumnTransformer. After that, apply SimpleImputer and StandardScaler to all features.
Here is a reminder of the make_column_transformer() and make_pipeline() functions you will use.
Taak
Veeg om te beginnen met coderen
- Import
make_pipeline. - Create
ctusingOneHotEncoderfor'sex'and'island', withremainder='passthrough'. - Build a pipeline:
ct→SimpleImputer('most_frequent')→StandardScaler. - Transform
Xand store the result inX_transformed.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 20
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.