Skip to content

Conversation

gaugup
Copy link
Collaborator

@gaugup gaugup commented Dec 15, 2020

  • 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 [email protected]

if is_tree_model and self._supports_categoricals(explainable_model):
# 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
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
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants