h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
http://h2o.ai
Apache License 2.0
6.94k stars 2k forks source link

Machine Learning Interpretability (Simple Approach) #10678

Closed exalate-issue-sync[bot] closed 1 year ago

exalate-issue-sync[bot] commented 1 year ago

1.1) Select a number of clusters for a data set, k. k is a user-defined hyperparameter, but guidance for selecting k can be found from the gap statistic https://web.stanford.edu/~hastie/Papers/gap.pdf or just selecting a large, computationally tractable k, say 2-4 orders of magnitude less than N, the number of rows in the data set.

1.2) k and clusters can also be defined by business rules or domain knowledge, such as Customer Lifetime Value or Lifecycle segment etc. If this is the case, skip step 2, and assign cluster labels based on business rules supplied by user.

2.) Find k clusters in the input space of the data set and join the cluster labels onto the data set by a unique key. Train clusters in X (model inputs), not in y (model target) or yhat (model predictions).

3.) Join the predictions (yhat) of complex ML that the user would like to understand onto the data set by a unique key or by scoring the data set with the complex ML model.

4.) Build an interpretable surrogate model for each cluster. Build an L1/elasticnet regression, a simple decision tree, or even run treeinterpreter on each cluster. The inputs for the surrogate model in each cluster are the original inputs, i.e those used in the clustering in phase 1.1; the target of the surrogate model is the yhat values for the complex model. Store these results for each cluster.

5.) When a user would like to understand the predictions of a complex model for a given record, x0, retrieve the results for the cluster to which x0 belongs and display in some meaningful way depending on the surrogate model used:

The key to this approach is the locality provided by the clusters. It's hard to approximate a complex ML model with one simple model. If you take a piece of the complex ML model, as defined by X and yhat in a cluster, you have a better chance of accurately approximating the model and understanding it's behavior in that region.

exalate-issue-sync[bot] commented 1 year ago

Patrick Hall commented: For now in h2o-3. Likely will revisit.

h2o-ops commented 1 year ago

JIRA Issue Migration Info

Jira Issue: PUBDEV-3780 Assignee: Patrick Hall Reporter: Venkatesh Yadav State: Closed Fix Version: N/A Attachments: N/A Development PRs: N/A