from sklearn.preprocessing import StandardScaler

#数据预处理标准化StandardScaler模型
def test_StandardScaler():
X=[[1,5,1,2,10],
[2,6,3,2,7],
[3,7,5,6,4,],
[4,8,7,8,1]]
print("before transform:",X)
scaler=StandardScaler()
scaler.fit(X)
print("scale_ is :",scaler.scale_)
print("mean_ is :",scaler.mean_)
print("var_ is :",scaler.var_)
print("after transform:",scaler.transform(X)) # 调用 test_StandardScaler
test_StandardScaler()

吴裕雄 python 机器学习——数据预处理标准化StandardScaler模型的更多相关文章

  1. 吴裕雄 python 机器学习——数据预处理标准化MaxAbsScaler模型

    from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[ ...

  2. 吴裕雄 python 机器学习——数据预处理标准化MinMaxScaler模型

    from sklearn.preprocessing import MinMaxScaler #数据预处理标准化MinMaxScaler模型 def test_MinMaxScaler(): X=[[ ...

  3. 吴裕雄 python 机器学习——数据预处理正则化Normalizer模型

    from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3, ...

  4. 吴裕雄 python 机器学习——数据预处理流水线Pipeline模型

    from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbor ...

  5. 吴裕雄 python 机器学习——数据预处理字典学习模型

    from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_Diction ...

  6. 吴裕雄 python 机器学习——数据预处理过滤式特征选取SelectPercentile模型

    from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def ...

  7. 吴裕雄 python 机器学习——数据预处理过滤式特征选取VarianceThreshold模型

    from sklearn.feature_selection import VarianceThreshold #数据预处理过滤式特征选取VarianceThreshold模型 def test_Va ...

  8. 吴裕雄 python 机器学习——数据预处理二元化OneHotEncoder模型

    from sklearn.preprocessing import OneHotEncoder #数据预处理二元化OneHotEncoder模型 def test_OneHotEncoder(): X ...

  9. 吴裕雄 python 机器学习——数据预处理二元化Binarizer模型

    from sklearn.preprocessing import Binarizer #数据预处理二元化Binarizer模型 def test_Binarizer(): X=[[1,2,3,4,5 ...

随机推荐

  1. Latex字体属性

    Latex字体有五种属性:编码.族.系列.尺寸.形状:其中,一般用户不会涉及字体的编码属性.用户可以自定义字体属性,定义属性的命令称为声明,声明无参数,直接在文档中使用.1. 族(family)属性: ...

  2. BZOJ的思维题

    5085:最大 给你一个n×m的矩形,要你找一个子矩形,价值为左上角左下角右上角右下角这四个数的最小值,要你最大化矩形 的价值. 关键点是要想到把这些值排序 值从小到大考虑,比如说现在最小的值是(x1 ...

  3. 已经安装了 AccessDatabaseEngine.exe,还是报错

    标题: SQL Server 导入和导出向导 ------------------------------ 操作无法完成. ------------------------------ 其他信息: 未 ...

  4. mysql-使用存储过程创建大批量数据

    参考:https://www.iteye.com/blog/825635381-2161290 场景1.创建1万个table,每个table种插入1条记录 DELIMITER $$ CREATE DA ...

  5. spark 为什么要用broadcast[转]

    为什么要用broadcast? 21down vote If you have huge array that is accessed from Spark Closures, for example ...

  6. RN开发-IDE和API

    一.开发工具 1.Visual Studio Code:微软IDE,轻量级,只有30+M大小 2.nuclide :仅支持Mac 3.WebStorm : JavaScript开发工具(IDE) 二. ...

  7. JDBC用户访问被拒绝

    线程“主”java中的异常.于sq1.sQLException:用户“root”@“localhost”被拒绝访问(使用密码:YES)root密码错误

  8. Linux下Libevent安装和简单实用

    前言 Libevent 是一个用C语言编写的.轻量级的开源高性能事件通知库,主要有以下几个亮点:事件驱动( event-driven),高性能;轻量级,专注于网络,不如 ACE 那么臃肿庞大:源代码相 ...

  9. ASP.NET Identity-验证与授权及管道事件

    https://www.cnblogs.com/OceanEyes/p/thinking-in-asp-net-mvc-apply-asp-net-identity-authentication.ht ...

  10. 洛谷P1051 谁拿了最多奖学金

    https://www.luogu.org/problem/P1051 #include<bits/stdc++.h> using namespace std; struct node { ...