吴裕雄 python 机器学习——数据预处理标准化StandardScaler模型
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模型的更多相关文章
- 吴裕雄 python 机器学习——数据预处理标准化MaxAbsScaler模型
		
from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[ ...
 - 吴裕雄 python 机器学习——数据预处理标准化MinMaxScaler模型
		
from sklearn.preprocessing import MinMaxScaler #数据预处理标准化MinMaxScaler模型 def test_MinMaxScaler(): X=[[ ...
 - 吴裕雄 python 机器学习——数据预处理正则化Normalizer模型
		
from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3, ...
 - 吴裕雄 python 机器学习——数据预处理流水线Pipeline模型
		
from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbor ...
 - 吴裕雄 python 机器学习——数据预处理字典学习模型
		
from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_Diction ...
 - 吴裕雄 python 机器学习——数据预处理过滤式特征选取SelectPercentile模型
		
from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def ...
 - 吴裕雄 python 机器学习——数据预处理过滤式特征选取VarianceThreshold模型
		
from sklearn.feature_selection import VarianceThreshold #数据预处理过滤式特征选取VarianceThreshold模型 def test_Va ...
 - 吴裕雄 python 机器学习——数据预处理二元化OneHotEncoder模型
		
from sklearn.preprocessing import OneHotEncoder #数据预处理二元化OneHotEncoder模型 def test_OneHotEncoder(): X ...
 - 吴裕雄 python 机器学习——数据预处理二元化Binarizer模型
		
from sklearn.preprocessing import Binarizer #数据预处理二元化Binarizer模型 def test_Binarizer(): X=[[1,2,3,4,5 ...
 
随机推荐
- 题解【AcWing91】最短Hamilton路径
			
题面 看到数据范围这么小,第一眼想到爆搜. 然而这样做的复杂度是 \(\mathcal{O}(n! \times n)\) 的,明显会 TLE. 于是考虑状压 DP. 我们设 \(dp_{i,j}\) ...
 - 【手抖康复训练1 】Codeforces Global Round 6
			
[手抖康复训练1 ]Codeforces Global Round 6 总结:不想复习随意打的一场,比赛开始就是熟悉的N分钟进不去时间,2333,太久没写题的后果就是:A 题手抖过不了样例 B题秒出思 ...
 - 为data中的某一个对象添加一个属性不起作用——this.$set的正确使用
			
this.$set(obj, key, value) 我们在项目开发的过程中,经常会遇到这种情况:为data中的某一个对象添加一个属性 <template> <div class=& ...
 - [CF1304F] Animal Observation - dp,单调队列
			
设 \(f[i][j]\) 为第 \(i\) 天在第 \(j\) 个位置放置的最大值,设 \(s[i][j]\) 是第 \(i\) 行的前缀和,则 \[ \begin{align} f[i][j] & ...
 - MariaDB Windows 安装
			
1.复制安装文件到服务器 2.解压到指定的目录,并创建my.ini: 3.编辑my.ini文件内容 [client] port=3307 [mysql] default-character-set=u ...
 - nvm —— Node版本管理工具
			
nvm下载 下载地址 下载nvm-setup.zip文件 nvm安装 1.以管理员身份运行install.cmd文件,设置文件路径 root: C:\Users\Administrator\AppDa ...
 - .NET知识梳理——4.特性Attribute
			
1. 特性 1.1 特性Attribute 特性就是一个类,继承自Attribute抽象类(该类无抽象方法.避免实例化),约定俗成用Attribute类结尾,标记时可省略掉Attribu ...
 - 0007 settings.py配置文件详解
			
01 DEBUG调试配置 开发期设置为True,发布时设置为False 02 INSTALLED_APPS已安装的APP配置 INSTALLED_APPS = [ 'django.contrib.ad ...
 - jQuery尺寸
			
jQuery 尺寸 jQuery width() 和 height() 方法 width() 方法设置或返回元素的宽度(不包括内边距.边框或外边距). height() 方法设置或返回元素的高度(不包 ...
 - 普通平衡树 lg3369
			
在多次学习splay后,我终于理解并码出了整份代码 参考了https://tiger0132.blog.luogu.org/slay-notes的博客 具体实现原理在上面这篇博客和百度中可以查到,接下 ...