from sklearn.feature_selection import  VarianceThreshold

#数据预处理过滤式特征选取VarianceThreshold模型
def test_VarianceThreshold():
X=[[100,1,2,3],
[100,4,5,6],
[100,7,8,9],
[101,11,12,13]]
selector=VarianceThreshold(1)
selector.fit(X)
print("Variances is %s"%selector.variances_)
print("After transform is %s"%selector.transform(X))
print("The surport is %s"%selector.get_support(True))
print("After reverse transform is %s"%selector.inverse_transform(selector.transform(X))) #调用test_VarianceThreshold()
test_VarianceThreshold()

吴裕雄 python 机器学习——数据预处理过滤式特征选取VarianceThreshold模型的更多相关文章

  1. 吴裕雄 python 机器学习——数据预处理过滤式特征选取SelectPercentile模型

    from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def ...

  2. 吴裕雄 python 机器学习——数据预处理包裹式特征选取模型

    from sklearn.svm import LinearSVC from sklearn.datasets import load_iris from sklearn.feature_select ...

  3. 吴裕雄 python 机器学习——数据预处理正则化Normalizer模型

    from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3, ...

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

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

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

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

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

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

  7. 吴裕雄 python 机器学习——数据预处理二元化OneHotEncoder模型

    from sklearn.preprocessing import OneHotEncoder #数据预处理二元化OneHotEncoder模型 def test_OneHotEncoder(): X ...

  8. 吴裕雄 python 机器学习——数据预处理二元化Binarizer模型

    from sklearn.preprocessing import Binarizer #数据预处理二元化Binarizer模型 def test_Binarizer(): X=[[1,2,3,4,5 ...

  9. 吴裕雄 python 机器学习——数据预处理字典学习模型

    from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_Diction ...

随机推荐

  1. 一道CTF针对XXE漏洞的练习

    题目链接:http://web.jarvisoj.com:9882/ 目的很明确获取/home/ctf/flag.txt的内容 一般读取目标机的本地文件都会用到file协议. 思路: 那么思路一:文件 ...

  2. linux多线程编程的应用场景

  3. SQLserver中存储图片

    两种方式1.存放图片路径2.转换成2进制流(不过这样的话将很占用数据库空间)存路径的方式就很简单了,下面着重给出转换成2进制流的存入以及读取方法.存入:string FilePath="&q ...

  4. Ubuntu 18.04 怎么安装Gnome Tweak Tool

    地址:https://jingyan.baidu.com/article/86f4a73ebd6c9437d7526963.html 终端键入命令:[sudo add-apt-repository u ...

  5. js - 文字

    居右 style="float:right;" 文字底部对齐(默认居中对齐) vertical-align:bottom; 文字居中 text-align:middle text- ...

  6. (原创)SpringBoot入门

    本文章是SpringBoot入门的介绍在这里   我会尽量写一些细节性的东西,我用的是IDEA2016  Tomcat7 JDK1.8 Maven3.3.9 IDEA Tomcat JDK Maven ...

  7. R Tidyverse dplyr包学习笔记2

    Tidyverse 学习笔记 1.gapminder 我理解的gapminder应该是一个内置的数据集 加载之后使用 > # Load the gapminder package > li ...

  8. 动图演示23个鲜为人知的VSCode快捷键

    动图演示23个鲜为人知的VSCode快捷键 原文地址:dev.to/devmount/23… 代码同步浏览器 安装vccode 安装live server插件 尽管我在VS Code中经常使用许多快捷 ...

  9. 一点点学习PS--实战二

    本节实战,可以学到如何制作gif动图,制作搜狗输入法皮肤 1.工具使用 (1)滤镜--液化--膨胀:这里是制作出猫咪打呼时肚子和气泡胀大的效果 (2)图像--画布大小:可裁剪画布到指定像素,并且裁剪指 ...

  10. 百度地图和echarts结合实例

    1.由echart对象(bmapChart)获取百度地图对象(bdMap),echart对象(bmapChart)适用于所有的echart的操作和接口,百度地图对象(bdMap)适用于百度地图的所有接 ...