Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Creating a Pipeline | Section
Machine Learning Foundations with Scikit-Learn
Section 1. Chapitre 20
single

single

bookChallenge: Creating a Pipeline

Glissez pour afficher le menu

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.

Tâche

Glissez pour commencer à coder

  1. Import make_pipeline.
  2. Create ct using OneHotEncoder for 'sex' and 'island', with remainder='passthrough'.
  3. Build a pipeline: ctSimpleImputer('most_frequent')StandardScaler.
  4. Transform X and store the result in X_transformed.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 20
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt