Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Creating a Pipeline | Section
Machine Learning Foundations with Scikit-Learn
Sección 1. Capítulo 20
single

single

bookChallenge: Creating a Pipeline

Desliza para mostrar el menú

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.

Tarea

Desliza para comenzar a programar

  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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 20
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt