sklearn.preprocessing 中standardscaler 和Normalizer 的区别 [英] Difference between standardscaler and Normalizer in sklearn.preprocessing

查看:46
本文介绍了sklearn.preprocessing 中standardscaler 和Normalizer 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sklearn.preprocessing 模块中的standardscaler 和normalizer 有什么区别?两者不做同样的事情吗?即使用偏差去除平均值和比例?

What is the difference between standardscaler and normalizer in sklearn.preprocessing module? Don't both do the same thing? i.e remove mean and scale using deviation?

推荐答案

来自 Normalizer 文档:

具有至少一个非零分量的每个样本(即数据矩阵的每一行)独立于其他样本重新缩放,使其范数(l1 或 l2)等于 1.

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.

StandardScaler

通过去除均值和缩放到单位方差来标准化特征

Standardize features by removing the mean and scaling to unit variance

换句话说,Normalizer 按行作用,StandardScaler 按列作用.归一化器不会删除均值和按偏差缩放,而是将整行缩放到单位范数.

In other words Normalizer acts row-wise and StandardScaler column-wise. Normalizer does not remove the mean and scale by deviation but scales the whole row to unit norm.

这篇关于sklearn.preprocessing 中standardscaler 和Normalizer 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆