Can anyone explain me StandardScaler?

前端 未结 9 499
一整个雨季
一整个雨季 2020-12-04 05:54

I am unable to understand the page of the StandardScaler in the documentation of sklearn.

Can anyone explain this to me in simple terms?

9条回答
  •  爱一瞬间的悲伤
    2020-12-04 06:47

    We apply StandardScalar() on a row basis.

    So, for each row in a column (I am assuming that you are working with a Pandas DataFrame):

    x_new = (x_original - mean_of_distribution) / std_of_distribution

    Few points -

    1. It is called Standard Scalar as we are dividing it by the standard deviation of the distribution (distr. of the feature). Similarly, you can guess for MinMaxScalar().

    2. The original distribution remains the same after applying StandardScalar(). It is a common misconception that the distribution gets changed to a Normal Distribution. We are just squashing the range into [0, 1].

提交回复
热议问题