def test_RFE():
'''
test the method of RFE, the number of feature aim to 2
:return: None
'''
iris=load_iris()
X=iris.data
y=iris.target
estimator=LinearSVC()
selector=RFE(estimator=estimator,n_features_to_select=2)
selector.fit(X,y)
print("N_features %s"%selector.n_features_)
print("Support is %s"%selector.support_)
print("Ranking %s"%selector.ranking_)
11.6 feature_selection_bagging.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录