Skip to content
START WITH A QUESTION

What would you like to understand?

Find an answer. See the moment it becomes clear. Follow the idea further.

← Concept directory

Answers for “如何在 scikit-learn 中使用 StandardScaler 标准化特征?”

3 keyword matches

Understanding your question. You can explore the search results below now.

Find a method

↗

Import `StandardScaler` from `sklearn.preprocessing`, instantiate it, and call `fit_transform` on the selected DataFrame columns. This transforms the data to have mean 0 and standard deviation 1.

Conditions: Input data is numerical.; Scikit-learn library is installed.

Find a method

↗

Import `MinMaxScaler` from `sklearn.preprocessing`, instantiate it, and call `fit_transform` on the selected DataFrame columns. This fits the scaler to the data (learning min/max) and transforms the values to the [0, 1] range.

Conditions: Input data is numerical.; Scikit-learn library is installed.

Meet the concept

↗

Standardization transforms a feature value xx into z=x−μσz = \frac{x - \mu}{\sigma}, targeting a mean of 0 and a standard deviation of 1 for the transformed feature.

Conditions: Applied per numerical feature.; Uses the feature mean μ\mu and standard deviation σ\sigma.; Assumes σ>0\sigma > 0.