标准缩放器和MinMaxScaler之间的区别 [英] Difference between Standard scaler and MinMaxScaler
问题描述
MinMaxScaler和标准缩放器有什么区别。
What is the difference between MinMaxScaler and standard scaler.
MMS = MinMaxScaler(feature_range =(0,1))
(在Program1中使用)
MMS= MinMaxScaler(feature_range = (0, 1))
( Used in Program1)
sc = StandardScaler()
(在另一个程序中,他们使用了Standard scaler和不是minMaxScaler)
sc = StandardScaler()
( In another program they used Standard scaler and not minMaxScaler)
推荐答案
来自 ScikitLearn网站:
StandardScaler
去除均值并将数据缩放为单位方差。
但是,离群值在计算经验性
均值和标准偏差时会产生影响,这会缩小要素
值的范围,如下图左图所示。特别要注意的是
是因为每个特征的离群值大小不同,因此每个特征上转换后的数据在
上的传播差异很大:大多数数据
位于[-2, 4]转换后的中位数收入
特征的范围,而相同的数据在转换后的家庭数量较小的[-0.2,0.2]
范围中被压缩。
StandardScaler
removes the mean and scales the data to unit variance. However, the outliers have an influence when computing the empirical mean and standard deviation which shrink the range of the feature values as shown in the left figure below. Note in particular that because the outliers on each feature have different magnitudes, the spread of the transformed data on each feature is very different: most of the data lie in the [-2, 4] range for the transformed median income feature while the same data is squeezed in the smaller [-0.2, 0.2] range for the transformed number of households.
StandardScaler无法保证在
中存在平衡的特征尺度。
StandardScaler therefore cannot guarantee balanced feature scales in the presence of outliers.
MinMaxScaler
重新缩放数据集,以使所有要素值在
的范围内[0,1],如下右面板所示。但是,这种
缩放比例会将
转换家庭数的所有inlier压缩在狭窄的范围内[0,0.005]。
MinMaxScaler
rescales the data set such that all feature values are in
the range [0, 1] as shown in the right panel below. However, this
scaling compress all inliers in the narrow range [0, 0.005] for the
transformed number of households.
这篇关于标准缩放器和MinMaxScaler之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!