Can Any One Explain how StandardScaler Works ??

@sriv.ansh

This scaler normalizes the data by subtracting the mean and dividing by the standard deviation.

StandardScaler is used to resize the distribution of values so that the mean of the observed values is 0 and the standard deviation is 1

y = (x – mean) / standard_deviation

- Import the necessary libraries required. We have imported sklearn library to use the Standard Scaler function.
- Load the dataset.
- Set an object to the StandardScaler() function.
- Segregate the independent and the target variables as required.
- Apply the function onto the dataset using the fit_transform() function.

1 Like