Skip to content

02 util: AttributeError: 'SelectFromModel' object has no attribute 'estimator_' #2

@kzfm

Description

@kzfm
feature_name[abs(selector_en.estimator.coef_)>selector_en.threshold_]

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-18-58d17a399d71> in <module>()
----> 1 feature_name[abs(selector_en.estimator.coef_)>selector_en.threshold_]

~/anaconda3/lib/python3.6/site-packages/sklearn/feature_selection/from_model.py in threshold_(self)
    172     @property
    173     def threshold_(self):
--> 174         scores = _get_feature_importances(self.estimator_, self.norm_order)
    175         return _calculate_threshold(self.estimator, scores, self.threshold)
    176 

AttributeError: 'SelectFromModel' object has no attribute 'estimator_'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions