8.特征选择

用过滤法对以下数据进行特征选择:

                             [[0,2,0,3],

                              [0,1,4,3],

                              [0,1,1,3]]

要求:

1、Variance Threshold(threshold =1.0)

2、将结果截图

复制代码
1 from sklearn.feature_selection import  VarianceThreshold
2 def var():
3     var =VarianceThreshold(threshold=1.0)
4     data=var.fit_transform([[0,2,0,3],[0,1,4,3],[0,1,1,3]])
5     print(data)
6     return None
7 
8 if __name__ =="__main__":
9     var()
复制代码

结果:

posted @ 2020-06-06 17:23  Doctor-Chan  阅读(115)  评论(0编辑  收藏  举报