机器学习之特征选择
用过滤法对以下数据进行特征选择:
[[0,2,0,3],
[0,1,4,3],
[0,1,1,3]]
要求:
1、Variance Threshold(threshold =1.0)
2、将结果截图放上来(没有条件的备注说明原因)注意:每个人的电脑ID是不一样的
from sklearn.feature_selection import VarianceThreshold def var(data, threshold): """ 特征选择-删除低方差得特征 :return: None """ var = VarianceThreshold(threshold=1.0) data = var.fit_transform(data) print("threshold=%d时\n"%threshold, data) return None if __name__ == "__main__": data = [[0,2,0,3], [0,1,4,3], [0,1,1,3]] var(data, 0.0) var(data, 1.0) var(data, 2.0)
相关推荐
Micusd 2020-11-19
人工智能 2020-11-19
81510295 2020-11-17
jaybeat 2020-11-17
flyfor0 2020-11-16
lgblove 2020-11-16
Pokemogo 2020-11-16
Pokemogo 2020-11-16
clong 2020-11-13
lizhengjava 2020-11-13
ohbxiaoxin 2020-11-13
Icevivian 2020-11-13
EchoYY 2020-11-12
CSDN人工智能头条 2020-11-11
mogigo00 2020-11-11
jaybeat 2020-11-10
白飞飞Alan 2020-11-11
lemonade 2020-11-10
机器学习之家 2020-11-10