Skip to content

Add validations for explainable model arguments in MimicExplainer - #354

Open
gaugup wants to merge 5 commits into
interpretml:mainfrom
gaugup:gaugup/ValidateExplainableModelParams
Open

Add validations for explainable model arguments in MimicExplainer#354
gaugup wants to merge 5 commits into
interpretml:mainfrom
gaugup:gaugup/ValidateExplainableModelParams

Conversation

@gaugup

@gaugup gaugup commented Dec 15, 2020

Copy link
Copy Markdown
Collaborator
  • It seems that there is no validations for explainable model parameters. This may cause cryptic Exceptions from explainable model classes. So catching these errors earlier.
  • Also refactoring some code around setting of parameters for explainable_model_args.

Signed-off-by: Gaurav Gupta gaugup@microsoft.com

Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
@@ -288,7 +289,6 @@ def __init__(self, model, initialization_examples, explainable_model, explainabl
# Index the categorical string columns for training data
self._column_indexer = initialization_examples.string_index(columns=categorical_features)
self._one_hot_encoder = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed?

             explainable_model_args[LightGBMParams.CATEGORICAL_FEATURE] = categorical_features 

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I guess you moved it to line 347, I guess that's ok, my only slight concern is now we are doing the same checks in multiple places:

is_tree_model = explainable_model.explainable_model_type == ExplainableModelType.TREE_EXPLAINABLE_MODEL_TYPE
        if is_tree_model and self._supports_categoricals(explainable_model):

but it's not expensive so I think it's ok

Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

Development

Successfully merging this pull request may close these issues.

2 participants