Create a base for managing groups of features.#357
Create a base for managing groups of features.#357lionelkusch merged 68 commits intomind-inria:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
==========================================
- Coverage 98.00% 97.95% -0.05%
==========================================
Files 22 22
Lines 1200 1223 +23
==========================================
+ Hits 1176 1198 +22
- Misses 24 25 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bthirion
left a comment
There was a problem hiding this comment.
The PR is mostly OK, thx.
jpaillard
left a comment
There was a problem hiding this comment.
I have a high-level comment, related to #377
Groups could also be dealt with in a pipeline fashion.
It would give a pipeline GroupFeatures --> FeatureImportance, where GroupFeatures could either be pre-defined or computed in the fit with clustering. That would also solve #377 since the groups could be defined at the instantiation of any FeatureImportance method.
This approach would have similarities with the ColumnTransformer in sklearn.
Let me know what you think.
|
Sorry, I'm missing what benefit you expect from it. |
I don't see what you mean. |
|
The addition of groups is equivalent to add a new dimension of the method, this is normal that the complexity will increase due to this. |
|
We should not add a feature that is not motivated by a use case. We want to add a class to handle groups. Would it make any example significantly simpler ? What is the actual benefit ? |
The group is used for LOCI (see PR #358) which is not inherited from BasePerturbation because BasePerturbation is the logic of marginal importance and feature importance is different. |
|
I think that there is a full agreement regarding the need to support feature groups. The question is whether adding a GroupFeatureImportance class is the right way to proceed. Two alternatives come to my mind:
|
What do you mean by VariablesGroup mixing? If I am correct, this was the spirit when I was coding this class. For native support, I am a bit against because this means that most of the methods should support feature groups, which is not the case, actually. |
|
@jpaillard @bthirion Last review? |
|
Good with me. |
jpaillard
left a comment
There was a problem hiding this comment.
I have a few minor comments, but otherwise it looks good.
Co-authored-by: Joseph Paillard <joseph.paillard@inria.fr>
Co-authored-by: Joseph Paillard <joseph.paillard@inria.fr>
Co-authored-by: Joseph Paillard <joseph.paillard@inria.fr>
Co-authored-by: Joseph Paillard <joseph.paillard@inria.fr>
Co-authored-by: Joseph Paillard <joseph.paillard@inria.fr>
Co-authored-by: Joseph Paillard <joseph.paillard@inria.fr>
* first commit * add section structure * [doc quick] [skip tests] skip * missing .rst? [doc quick] [skip tests] * fix link [doc quick] [skip tests] * add CFI fiirst draft and TSI [doc quick] [skip tests] * missing space? [doc quick] [skip tests] * replace space * [doc quick] [skip tests] * add ref and note section [doc quick] [skip tests] * add code snippets * typo cfi [doc quick] [skip tests] * add total sobol index ref [doc quick] [skip tests] * add copy button [doc quick] [skip tests] * missing sphinx requirements [quick doc] [skip tests] * add copybutton config * [doc quick] [skip tests] * solve example test * clarify "sub-model" for classif and regression * trry add figure + update note * add intro * try fix image path * trigger CI * try not to scale * definition * try image * [skip tests] trigger CI * [tests skip] another one * trigger CI * back to figure * add inference section * add reff * skip tests * [skip tests] * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: lionel kusch <lionel.kusch@grenoble-inp.org> * [skip tests] format bullet * rephrase not * [skip tests] * [skip tests] * [skip tests] linkcheck generated ignore images * [skip tests] linkcheck generated ignore * review * trigger CI * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * genetic example * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/total_sobol_index.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: bthirion <bertrand.thirion@inria.fr> * Update docs/src/model_agnostic_methods/conditional_feature_importance.rst Co-authored-by: bthirion <bertrand.thirion@inria.fr> * Update docs/src/model_agnostic_methods/total_sobol_index.rst Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> --------- Co-authored-by: jpaillard <joseph.paillard@inria.fr> Co-authored-by: lionel kusch <lionel.kusch@grenoble-inp.org> Co-authored-by: Ángel Reyero Lobo <angelreyerolobo@gmail.com> Co-authored-by: bthirion <bertrand.thirion@inria.fr>
I created an Abstract class for the management of the group of features.
I update the name of
groupsbyfeatures_groups.