Why do standardscaler and normalizer need different data input?

对着背影说爱祢 提交于 2019-12-06 06:10:53

This is expected behavior, because StandardScaler and Normalizer serve different purposes. The StandardScaler works 'vertically', because it...

Standardize[s] features by removing the mean and scaling to unit variance

[...] Centering and scaling happen independently on each feature by computing the relevant statistics on the samples in the training set. Mean and standard deviation are then stored to be used on later data using the transform method.

while the Normalizer works 'horizontally', because it...

Normalize[s] samples individually to unit norm.

Each sample (i.e. each row of the data matrix) with at least one non zero component is rescaled independently of other samples so that its norm (l1 or l2) equals one.

Please have a look at the scikit-learn docs (links above), to get more insight, which serves your purpose better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!