def test_SelectFromModel():
'''
test the method of SelectFromModel
:return: None
'''
digits=load_digits()
X=digits.data
y=digits.target
estimator=LinearSVC(penalty='l1',dual=False)
selector=SelectFromModel(estimator=estimator,threshold='mean')
selector.fit(X,y)
selector.transform(X)
print("Threshold %s"%selector.threshold_)
print("Support is %s"%selector.get_support(indices=True))
11.7 feature_selection_embeded.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录