You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Norm inconsistency between RFE and SelectFromModel #2121
In each RFE iteration, the step features with the lowest importance are discarded. A similar thing happens in SelectFromModel (but selection is by threshold rather than by number of features). There are some inconsistencies:
the mixin admits either est.coef_ or est.feature_importances_ as the basis of its calculation; RFE only coef_ fixed in [MRG+1] Fix RFE #4496
the mixin uses np.abs(est.coef_), while RFE uses safe_sqr(est.coef_). The result is the same for selecting features by quantity, as long as coef_ is 1d, but where 2d, the sum is taken over axis 0, and the ordering under L1 and L2 norms may differ.
Should RFE support feature_importances_? For coef_.ndim == 2, should SelectFromModel use sqrt(sqr(coef_).sum(axis=0))?
changed the title [-]Inconsistencies between RFE and _LearntSelectorMixin[/-][+]Norm inconsistencies between RFE and _LearntSelectorMixin[/+]on Jan 12, 2016
changed the title [-]Norm inconsistencies between RFE and _LearntSelectorMixin[/-][+]Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin)[/+]on Jan 12, 2016
I'd be fine with that. I was considering knocking together a quick patch myself. I don't think it will be a much-used feature, but providing the option of consistency seems worthwhile.
Please implement it to accept any numpy.linalg.norm setting, defaulting to the incumbent approach.
changed the title [-]Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin)[/-][+]Norm inconsistency between RFE and SelectFromModel[/+]on Jun 28, 2017
Activity
Fix RFE - Add the possibility to use feature_importances rather than …
Fix RFE - Add the possibility to use feature_importances rather than …
raghavrv commentedon Jan 12, 2016
@jnothman This is fixed in #4496? If so could you close this one?
jnothman commentedon Jan 12, 2016
Part of it is. There's still the norm discrepancy, I think.
[-]Inconsistencies between RFE and _LearntSelectorMixin[/-][+]Norm inconsistencies between RFE and _LearntSelectorMixin[/+][-]Norm inconsistencies between RFE and _LearntSelectorMixin[/-][+]Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin)[/+]jnothman commentedon Jan 12, 2016
Perhaps now that
SelectFromModelis a separate metaestimator, we could offer a choice of L1/L2 norm for 2d coefs.antoinewdg commentedon Jan 12, 2016
Can I work on this one ?
jnothman commentedon Jan 12, 2016
I'd be fine with that. I was considering knocking together a quick patch myself. I don't think it will be a much-used feature, but providing the option of consistency seems worthwhile.
Please implement it to accept any
numpy.linalg.normsetting, defaulting to the incumbent approach.Norm inconsistency between RFE and SelectFromModel (was _LearntSelect…
[MRG+2] Norm inconsistency between RFE and SelectFromModel (was _Lear…
[MRG+2] Norm inconsistency between RFE and SelectFromModel (was _Lear…
[MRG+2] Norm inconsistency between RFE and SelectFromModel (was _Lear…
[-]Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin)[/-][+]Norm inconsistency between RFE and SelectFromModel[/+]jnothman commentedon Jun 28, 2017
We now have an option in SelectFromModel but not in RFE
[MRG+2] Norm inconsistency between RFE and SelectFromModel (was _Lear…
[MRG+2] Norm inconsistency between RFE and SelectFromModel (was _Lear…
JanFidor commentedon Feb 15, 2023
Could I pick up this issue?
haiatn commentedon Aug 26, 2023
I see #6181 was merged is there anything more to do here or could this be completed?
adrinjalali commentedon Apr 17, 2024
@haiatn you've done some amazing triaging here. Thank you ❤️