Scikit Normalize功能;意外行为

问题描述

在python中,我正在研究数据模型。我用几种方法来处理几列以标准化数据。对于一列,基于分布(正态),我想我需要一个一般的归一化。我正在使用numpy,对于其他列,我成功使用了preprocessing.normalize函数:

gh_pd = train.select('data').toPandas()
gh_pd.describe()

count   454015.000000
mean    20.512661
std 2.832815
min 11.000000
25% 19.000000
50% 21.000000
75% 22.000000
max 33.000000

然后我跑

gh_normalized = preprocessing.normalize(gh_pd) 
stats.describe(gh_normalized)

我得到:

DescribeResult(nobs=454015,minmax=(array([1.]),array([1.])),mean=array([1.]),variance=array([0.]),skewness=array([0.]),kurtosis=array([-3.]))

我希望最小值接近0,最大值接近1。我误解了什么,为什么它可以在其他列上使用?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...