from sklearn.preprocessing import Normalizer

#数据预处理正则化Normalizer模型
def test_Normalizer():
X=[[1,2,3,4,5],
[5,4,3,2,1],
[1,3,5,2,4,],
[2,4,1,3,5]]
print("before transform:",X)
normalizer=Normalizer(norm='l2')
print("after transform:",normalizer.transform(X)) # 调用 test_Normalizer
test_Normalizer()

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

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

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

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

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

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

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

  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. 【C语言】求s(n)=a+aa+aaa+...+aa...a的值

    原理:比如a=2,s(1)=2,s(2)=2+2*10+2,s(3)=2+2*10+2+(2*10+2)*10+2   ..... 规律: item=item*10+a sum=sum+item 代码 ...

  2. [AT3867] Digit Sum 2

    给出N,求小于等于N的正整数中用十进制表示各数位数字之和的最大值. Solution 如果是X999的形式,那么就是自己 否则,就是(X-1)999 #include <bits/stdc++. ...

  3. 到头来还是逃不开Java - Java13核心类

    Java13核心类 没有特殊说明,我的所有学习笔记都是从廖老师那里摘抄过来的,侵删 引言 兜兜转转到了大四,学过了C,C++,C#,Java,Python,学一门丢一门,到了最后还是要把Java捡起来 ...

  4. 论Mac与windows的STS下的路径问题

    mac下的 <!-- javaBean生成在哪里 --> <javaModelGenerator targetPackage="com.atcrowdfunding.bea ...

  5. linux切换普通用户遇bash-4.1解决

    1,修改vim  /etc/passwd 把对应用户的登陆环境改成,/bin/bash 2,复制配置 cp -a /etc/skel/. /home/www/ 3再次尝试su www有效

  6. hadoop搭建HA集群之后不能自动切换namenode

    在搭好HA集群之后,想测试一下集群的高可用性,于是先把active的namenode给停掉: hadoop-daemon.sh stop namenode 或者直接kill掉该节点namenode的对 ...

  7. 【算法】状态压缩DP

    状态压缩DP是什么? 答:利用位运算(位运算比加减乘除都快!)来记录状态,并实现动态规划. 适用于什么问题? 答:数据规模较小:不能使用简单的算法解决. 例题: 题目描述 糖果店的老板一共有M 种口味 ...

  8. Linux package installation: deb and rpm

    一般来说著名的 Linux 系统基本上分两大类: RedHat 系列:Redhat.Centos.Fedora 等 Debian 系列:Debian.Ubuntu 等 Dpkg (Debian系): ...

  9. ORA-00904: "I_LEVEL": invalid identifier

    问题描述 ORA-00904: "I_LEVEL": invalid identifier 标示符无效

  10. HTML链接标签

    <a>超链接标签:常用属性: href:指定地址,要有HTTP协议.如果是本网站的html文件可以写路径 target:以什么方式打开 _self:在当前窗口打开(默认) _blank:新 ...