from sklearn.preprocessing import MaxAbsScaler

#数据预处理标准化MaxAbsScaler模型
def test_MaxAbsScaler():
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=MaxAbsScaler()
scaler.fit(X)
print("scale_ is :",scaler.scale_)
print("max_abs_ is :",scaler.max_abs_)
print("after transform:",scaler.transform(X)) # 调用 test_MaxAbsScaler
test_MaxAbsScaler()

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

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

    from sklearn.preprocessing import StandardScaler #数据预处理标准化StandardScaler模型 def test_StandardScaler() ...

  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. Navicat Premium怎么设置字段的唯一性(UNIQUE)?

    参考链接:https://blog.csdn.net/Song_JiangTao/article/details/82192189 1.打开你想要设计的表 这里写图片描述2.清楚你想要设计哪个字段为唯 ...

  2. 转载:dsp芯片的定点运算

    转自: http://ishare.iask.sina.com.cn/f/37179153.html

  3. numpy学习(三)

    练习篇(Part 3) 31. 略 32. Is the following expressions true? (★☆☆) np.sqrt(-1) == np.emath.sqrt(-1) prin ...

  4. [CF1304F] Animal Observation - dp,单调队列

    设 \(f[i][j]\) 为第 \(i\) 天在第 \(j\) 个位置放置的最大值,设 \(s[i][j]\) 是第 \(i\) 行的前缀和,则 \[ \begin{align} f[i][j] & ...

  5. Wannafly Camp 2020 Day 6K 最大权值排列

    按照样例那样排列即可 #include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if( ...

  6. Codeforces 383C Propagating tree, 线段树, 黑白染色思想

    按深度染色,奇深度的点存反权值. #include <bits/stdc++.h> using namespace std; vector <]; ],a[],s[],vis[],i ...

  7. C语言-无符号数与有符号数不为人知的秘密

    一.无符号数与有符号数 1.计算机中的符号位 数据类型的最高位用于标识数据的符号 -最高位为1,表明这个数为负数 -最高位为0,表明这个数为正数 #include <stdio.h> in ...

  8. SpringBoot整合RabbitMQ出现org.springframework.amqp.AmqpException: No method found for class

    @Component @RabbitListener(queues="my_fanout") public class Consumer {     @RabbitHandler  ...

  9. ECMAScript基本语法——③数据类型

    Java内有两种 基本数据类型:4类八种 引用数据类型:对象 JavaScript也有两种 原始数据类型 其实是基本数据类型 number:数字.整数.小数.NaN(特殊的数字,not a numbe ...

  10. Gol流程控制

    条件语句 if语句 if 布尔表达式 { }else 布尔表达式{ }else{ } if语句后的{,一定要和if条件写在同一行,否则报错 else一定要在if语句}之后,不能自己另起一行 if语句变 ...