Repository navigation
Fix importance computation for single-distributed params - #6500
Conversation
There was a problem hiding this comment.
Thank you for your pull request. I have two concerns regarding this change:
- The documentation for
get_param_importances()function states that "the sum of the importance values are normalized to 1.0." If all parameters return 0.0, this rule will be violated. Do we need to update the documentation? - Currently, Optuna Dashboard handles an empty importance dict by assigning
1 / len(search_space)to each parameter to ensure the sum equals 1. So that this PR changes the current behavior of Optuna Dashboard as well.
What do you think?
|
Thank you for your comment. Based on my understanding, neither point 1 nor point 2 is problematic.
optuna/optuna/importance/__init__.py Lines 104 to 114 in 9d731e5
|
|
This pull request has not seen any recent activity. |
Motivation & Description of the changes
Optuna's importance evaluators behave inconsistently when a parameter's distribution is single.
fANOVA and PED-ANOVA return
{}if all parameters are single-distributed. On the other hand, MeanDecreaseImpurity returns the importance of all parameters as0.0.PED-ANOVA returns
0.0for single-distributed parameters if any parameters are not single-distributed (this behavior is inconsistent with the case where all parameters are single-distributed, cf. L239 and L265).Currently, those behaviors are undocumented and solely implementation-dependent. However, if a variable can only take on certain values, the importance can trivially be defined as
0.0rather than undefined.This PR changes the evaluators to return some importance for all parameters (especially,
0.0if single-distributed). This ensures that access toparam_importance[single_param_name]is always valid.