Challenge: Scaling the Features
In this challenge, scale the features of the penguins dataset (already encoded and without missing values) using StandardScaler
.
12345import 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)
Here is a little reminder of the StandardScaler
class.
Swipe to start coding
- Import the class that standardizes features by making the mean equal to 0 and the variance equal to 1.
- Initialize the scaler.
- Scale the
X
matrix of features.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
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?
Awesome!
Completion rate improved to 3.13
Challenge: 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
.
12345import 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)
Here is a little reminder of the StandardScaler
class.
Swipe to start coding
- Import the class that standardizes features by making the mean equal to 0 and the variance equal to 1.
- Initialize the scaler.
- Scale the
X
matrix of features.
Solution
Thanks for your feedback!
Awesome!
Completion rate improved to 3.13single