11.7 feature_selection_embeded.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:ML-note 作者: JasonK93 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号