Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Scaling the Features | Preprocessing Data with Scikit-learn
ML Introduction with scikit-learn

bookChallenge: Scaling the Features

In this challenge, scale the features of the penguins dataset (already encoded and without missing values) using StandardScaler.

12345
import pandas as pd df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/a65bbc96-309e-4df9-a790-a1eb8c815a1c/penguins_imputed_encoded.csv') print(df)
copy

Here is a little reminder of the StandardScaler class.

Task

Swipe to start coding

  1. Import the class that standardizes features by making the mean equal to 0 and the variance equal to 1.
  2. Initialize the scaler.
  3. Scale the X matrix of features.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 11
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

How do I use StandardScaler to scale the penguins dataset?

Can you show me how to fit and transform the data with StandardScaler?

What does scaling the features with StandardScaler achieve?

close

Awesome!

Completion rate improved to 3.13

bookChallenge: Scaling the Features

Swipe to show menu

In this challenge, scale the features of the penguins dataset (already encoded and without missing values) using StandardScaler.

12345
import pandas as pd df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/a65bbc96-309e-4df9-a790-a1eb8c815a1c/penguins_imputed_encoded.csv') print(df)
copy

Here is a little reminder of the StandardScaler class.

Task

Swipe to start coding

  1. Import the class that standardizes features by making the mean equal to 0 and the variance equal to 1.
  2. Initialize the scaler.
  3. Scale the X matrix of features.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 3.13
SectionΒ 2. ChapterΒ 11
single

single

some-alt