Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Creating a Pipeline | Pipelines
ML Introduction with scikit-learn
course content

Contenido del Curso

ML Introduction with scikit-learn

ML Introduction with scikit-learn

1. Machine Learning Concepts
2. Preprocessing Data with Scikit-learn
3. Pipelines
4. Modeling

bookChallenge: Creating a Pipeline

In this challenge, you need to put all the preprocessing steps we did together into one pipeline. The dataset is the initial penguins.csv file we started from.

The first step is to remove two useless rows. Then you will have to create a pipeline containing encoding, imputing, and scaling.

You need to encode only two columns, 'sex' and 'island'. Since you do not want to encode the entire X, you must use a ColumnTransformer. Afterward, apply the SimpleImputer and StandardScaler to the entire X.

Here is a reminder of the make_column_transformer() and make_pipeline() functions you will use.

Tarea
test

Swipe to show code editor

  1. Import the correct function for creating a pipeline.
  2. Make a ColumnTransformer with the OneHotEncoder applied only to columns 'sex' and 'island'.
  3. Make sure that all other columns remain untouched.
  4. Create a pipeline containing ct you just created, SimpleImputer that fills in missing values with the most frequent value and a StandardScaler as a last step.
  5. Transform the X using the pipe you created.

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 3. Capítulo 4
toggle bottom row

bookChallenge: Creating a Pipeline

In this challenge, you need to put all the preprocessing steps we did together into one pipeline. The dataset is the initial penguins.csv file we started from.

The first step is to remove two useless rows. Then you will have to create a pipeline containing encoding, imputing, and scaling.

You need to encode only two columns, 'sex' and 'island'. Since you do not want to encode the entire X, you must use a ColumnTransformer. Afterward, apply the SimpleImputer and StandardScaler to the entire X.

Here is a reminder of the make_column_transformer() and make_pipeline() functions you will use.

Tarea
test

Swipe to show code editor

  1. Import the correct function for creating a pipeline.
  2. Make a ColumnTransformer with the OneHotEncoder applied only to columns 'sex' and 'island'.
  3. Make sure that all other columns remain untouched.
  4. Create a pipeline containing ct you just created, SimpleImputer that fills in missing values with the most frequent value and a StandardScaler as a last step.
  5. Transform the X using the pipe you created.

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 3. Capítulo 4
toggle bottom row

bookChallenge: Creating a Pipeline

In this challenge, you need to put all the preprocessing steps we did together into one pipeline. The dataset is the initial penguins.csv file we started from.

The first step is to remove two useless rows. Then you will have to create a pipeline containing encoding, imputing, and scaling.

You need to encode only two columns, 'sex' and 'island'. Since you do not want to encode the entire X, you must use a ColumnTransformer. Afterward, apply the SimpleImputer and StandardScaler to the entire X.

Here is a reminder of the make_column_transformer() and make_pipeline() functions you will use.

Tarea
test

Swipe to show code editor

  1. Import the correct function for creating a pipeline.
  2. Make a ColumnTransformer with the OneHotEncoder applied only to columns 'sex' and 'island'.
  3. Make sure that all other columns remain untouched.
  4. Create a pipeline containing ct you just created, SimpleImputer that fills in missing values with the most frequent value and a StandardScaler as a last step.
  5. Transform the X using the pipe you created.

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!

In this challenge, you need to put all the preprocessing steps we did together into one pipeline. The dataset is the initial penguins.csv file we started from.

The first step is to remove two useless rows. Then you will have to create a pipeline containing encoding, imputing, and scaling.

You need to encode only two columns, 'sex' and 'island'. Since you do not want to encode the entire X, you must use a ColumnTransformer. Afterward, apply the SimpleImputer and StandardScaler to the entire X.

Here is a reminder of the make_column_transformer() and make_pipeline() functions you will use.

Tarea
test

Swipe to show code editor

  1. Import the correct function for creating a pipeline.
  2. Make a ColumnTransformer with the OneHotEncoder applied only to columns 'sex' and 'island'.
  3. Make sure that all other columns remain untouched.
  4. Create a pipeline containing ct you just created, SimpleImputer that fills in missing values with the most frequent value and a StandardScaler as a last step.
  5. Transform the X using the pipe you created.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 3. Capítulo 4
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt