TD_SHAP Function | SHAP | Teradata Vantage - TD_SHAP - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
lifecycle
latest
Product Category
Teradata Vantageā„¢

SHapley Additive exPlanations (SHAP) algorithm is a method to explain individual predictions (feature contributions) for a machine learning model based on the cooperative game theory. SHAP computes the contribution of each feature in a prediction as as average marginal contribution of the feature value across all possible coalitions. TD_SHAP also computes mean absolute contribution of each feature as global explanation (using OUT clause) which can be used as a measure of feature importance.

TD_SHAP supports the regression and classification models of the following functions:

  • TD_GLM
  • TD_DecisionForest
  • TD_XGBoost

For Tree-based methods, SHAP computation is quite intensive and therefore should be run on a small subset of prediction dataset. TD_SHAP needs an input table and a model table to output the feature contribution based on Shapley values.

The following is an example of how to use TD_SHAP:

  1. Prepare training dataset to be used for building a classification or regression model.
  2. Generate model using the training dataset. The supported functions are: TD_GLM, TD_DecisionForest, and TD_XGBoost.
  3. Prepare test dataset to be used for prediction/evaluating the model for SHAP contributions.
  4. Generate SHAP contributions on test dataset using TD_SHAP function.