Main Content

Generalized Additive Model

Interpretable model composed of univariate and bivariate shape functions for binary classification

Use fitcgam to fit a generalized additive model for binary classification.

A generalized additive model (GAM) is an interpretable model that explains class scores (the logit of class probabilities) using a sum of univariate and bivariate shape functions of predictors. fitcgam uses a boosted tree as a shape function for each predictor and, optionally, each pair of predictors; therefore, the function can capture a nonlinear relation between a predictor and the response variable. Because contributions of individual shape functions to the prediction (classification score) are well separated, the model is easy to interpret.

Objects

ClassificationGAMGeneralized additive model (GAM) for binary classification (Since R2021a)
CompactClassificationGAMCompact generalized additive model (GAM) for binary classification (Since R2021a)
ClassificationPartitionedGAMCross-validated generalized additive model (GAM) for classification (Since R2021a)

Functions

expand all

fitcgamFit generalized additive model (GAM) for binary classification (Since R2021a)
compactReduce size of machine learning model
crossvalCross-validate machine learning model
templateGAMGeneralized additive model (GAM) learner template (Since R2023b)
addInteractionsAdd interaction terms to univariate generalized additive model (GAM) (Since R2021a)
resumeResume training of generalized additive model (GAM) (Since R2021a)
limeLocal interpretable model-agnostic explanations (LIME) (Since R2020b)
partialDependenceCompute partial dependence (Since R2020b)
plotLocalEffectsPlot local effects of terms in generalized additive model (GAM) (Since R2021a)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
shapleyShapley values (Since R2021a)
predictClassify observations using generalized additive model (GAM) (Since R2021a)
lossClassification loss for generalized additive model (GAM) (Since R2021a)
marginClassification margins for generalized additive model (GAM) (Since R2021a)
edgeClassification edge for generalized additive model (GAM) (Since R2021a)
resubPredictClassify training data using trained classifier
resubLossResubstitution classification loss
resubMarginResubstitution classification margin
resubEdgeResubstitution classification edge
kfoldPredictClassify observations in cross-validated classification model
kfoldLossClassification loss for cross-validated classification model
kfoldMarginClassification margins for cross-validated classification model
kfoldEdgeClassification edge for cross-validated classification model
kfoldfunCross-validate function for classification
compareHoldoutCompare accuracies of two classification models using new data
testckfoldCompare accuracies of two classification models by repeated cross-validation

Topics