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. (填坑系列) 用aio写server与client进行通信的坑

    最近闲来无事,就估摸着自己写个“服务注册中心”来玩,当然因为是个人写的,所以一般都是简洁版本. 代码地址在:https://gitee.com/zhxs_code/my-service-registe ...

  2. 数据升级包 - bin文件

    运行完升级包后,正常的现象 开头: 结尾:  

  3. RN开发-Flex

    1.容器属性        (1). display : flex | inline-flex (块级伸缩容器 | 行内级伸缩容器)        (2). flex-direction : row ...

  4. python基础数据类型整理

    一.数据类型 (一).小技巧 1.PyCharm:选中多行,按"Ctrl+/"可批量注释掉 (二).字符串 1.startswith(str,[,start][,end]) #判断 ...

  5. C#WinForm 实现登录界面验证码功能(区分大小写+不区分大小写)

    原文:C#WinForm 实现登录界面验证码功能(区分大小写+不区分大小写) 文章来自:https://blog.csdn.net/IT_xiao_guang_guang/article/detail ...

  6. 保存数据到文件的模块(json,pickle,shelve,configparser,xml)_python

    一.各模块的主要功能区别 json模块:将数据对象从内存中完成序列化存储,但是不能对函数和类进行序列化,写入的格式是明文.  (与其他大多语言交互的类型) pickle模块:将数据对象从内存中完成序列 ...

  7. CSS技巧!鼠标经过图片抖动效果

    把代码加到style.css(模板的主css里面): /**图片抖动**/ img:hover{-webkit-animation: tada 1s .2s ease both;-moz-animat ...

  8. 一次 utf-8 bom引起的问题

    同事代码新增加了功能,推到服务器上,意外导致登录失败,回退到之前的版本上,可以正常使用. 这次只上传了 route.php 文件,系统登录失败. 随后使用kdiff3对比了两版本的route.php文 ...

  9. linux 命令 mkdir

    mkdir -p 如果要创建目录A并创建目录A的子目录B,没有用-p的情况下mkdir 逐个的创建目录(mkdir A,mkdir A/B); 如果用-p 可以直接创建2个目录 mkdir -p A/ ...

  10. 2018-2019-20175334实验四《Android程序设计》实验报告

    2018-2019-20175334实验四<Android程序设计>实验报告 一.实验内容及步骤 实验四 Android程序设计-1 Android Stuidio的安装测试: 参考< ...