eli5 icon indicating copy to clipboard operation
eli5 copied to clipboard

Add scikit-learn-contrib/stability-selection and improve randomized_l1 transformers

Open teabolt opened this issue 5 years ago • 2 comments

Closes #305.

  • Take stability_selection.StabilitySelection(https://github.com/scikit-learn-contrib/stability-selection) as an argument to transform_feature_names.
  • Add stability selection tests.
  • Mention stability selection in the docs.
  • Register possibly missing dependencies through a wrapper. See @lopuhin's suggestions https://github.com/TeamHG-Memex/eli5/pull/302#discussion_r269882856.

Coverage should increase once scikit-learn 0.21 and scikit-learn-contrib/stability-selection are tested against (could modify the tox config for this?).

If more use cases come up for functions like register_notnone and instantiate_notnone, they could be moved to base_utils.py or similar.

teabolt avatar Apr 29 '19 00:04 teabolt

Codecov Report

Merging #308 into master will decrease coverage by 0.02%. The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
- Coverage   97.09%   97.07%   -0.03%     
==========================================
  Files          44       44              
  Lines        2856     2868      +12     
  Branches      542      543       +1     
==========================================
+ Hits         2773     2784      +11     
- Misses         45       46       +1     
  Partials       38       38
Impacted Files Coverage Δ
eli5/sklearn/transform.py 93.61% <83.33%> (-0.67%) :arrow_down:

codecov-io avatar Apr 29 '19 19:04 codecov-io

Re: two test parametrizations for RandomizedLasso, one for scikit-learn < 0.19 and another for scikit-learn >= 0.19. It might be possible to reduce these to just one test by passing certain parameters to the RandomizedLasso so that the same features are selected in both scikit-learn versions. See also history of randomized_l1 https://github.com/scikit-learn/scikit-learn/commits/0.20.X/sklearn/linear_model/randomized_l1.py for what might be causing the difference in selected features.

teabolt avatar Apr 29 '19 19:04 teabolt