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. Doing Homework HDU - 1074 状态压缩

    #include<iostream> #include<cstring> #include<cstdio> #include<string> #incl ...

  2. 拦截器 Filter : js、css、jpg、png等静态资源不被拦截解决方案

    方案一: web.xml配置文件拦截范围缩小 ,没有必要 /*的配置拦截项目下所有资源. <filter> <filter-name>Login</filter-name ...

  3. C++ 获取当前正在执行的函数的相关信息(转)

    该功能用在日志打印中 原文地址:C++ 获取当前正在执行的函数的相关信息

  4. liunx 中设置zookeeper 自启动(service zookeeper does not support chkconfig)

    在liunx 上设置zookeeper 自启动 1.进入目录 cd /etc/init.d 2.创建一个文件 vim zookeeper 3.编辑zookeepr 文件 连接liunx使用的软件是fi ...

  5. could not parse as expression: "/login" (template: "include/include" - line 32, col 42)

    <li><a href="login.html" th:href="/login">登录</a></li> or ...

  6. 解决ASP.Net第一次访问慢的处理 IIS 7.5

    1.先安装ApplicationInitialization Module for IIS 7.5(微软发布的针对针对前期的IIS单独模块),再安装ApplicationInitialization ...

  7. Python 排序---sort与sorted学习(这是摘录别人的资源总结,自己可临摹学习)

    第一种:内建方法sort() 可以直接对列表进行排序 用法: list.sort(func=None, key=None, reverse=False(or True)) 对于reverse这个boo ...

  8. C语言修炼之二

    1.内存操作: (1)内存指针.函数指针: (2)动态内存谁申请谁释放(malloc和free成对出现). 2.

  9. EF CodeFirst配置领域类

    当我们不想使用EF的默认约定时,可以手动配置领域类,但还是推荐少配置,Simple is best! 两种配置方式: 1.Data Annotation Attributes[数据注解特性]  数据注 ...

  10. Laravel 中使用 Laravel-Excel 美化

    <?php use Maatwebsite\Excel\Classes\LaravelExcelWorksheet; use Maatwebsite\Excel\Exceptions\Larav ...