scikit-learn-contrib / skope-rules

machine learning with logical rules in Python
http://skope-rules.readthedocs.io
Other
599 stars 96 forks source link

The terms of the rules could be re-ordered in a better way, with hardly no computational cost. #1

Open datajms opened 6 years ago

datajms commented 6 years ago

Currently, rules terms are ordered alphabetically regarding to the variable names. Extra interpretability could be added by ordering the terms by decreasing "variable importance".

Reference: A Survey Of Methods For Explaining Black Box Models, R. Guidotti et al., Feb. 2018 Extract of the paper: "The interpretation of rules and decision trees is different with respect to different aspects. Decision trees are widely adopted for their graphical representation, while rules have a textual representation. The main difference is that textual representation does not provide immediately information about the more relevant attributes of a rule. On the other hand, the hierarchical position of the features in a tree gives this kind of clue. Attributes’ relative importance could be added to rules by means of positional information. Specifically, rule conditions are shown by following the order in which the rule extraction algorithm added them to the rule. Even though the representation of rules causes some difficulties in understanding the whole model, it enables the study of single rules representing partial parts of the whole knowledge (“local patterns”) which are composable."

ngoix commented 6 years ago

+1 for ordering terms by feature importance

floriangardin commented 6 years ago

I submitted a pull request for this issue : #12 The terms are ordered by feature importance and it is robust to the use of max_samples_features parameter.