Main Content

# Generalized Additive Model

Interpretable model composed of univariate and bivariate shape functions for regression

Use `fitrgam` to fit a generalized additive model for regression.

A generalized additive model (GAM) is an interpretable model that explains a response variable using a sum of univariate and bivariate shape functions of predictors. `fitrgam` 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 (response value) are well separated, the model is easy to interpret.

## Objects

 `RegressionGAM` Generalized additive model (GAM) for regression (Since R2021a) `CompactRegressionGAM` Compact generalized additive model (GAM) for regression (Since R2021a) `RegressionPartitionedGAM` Cross-validated generalized additive model (GAM) for regression (Since R2021a)

## Functions

expand all

 `fitrgam` Fit generalized additive model (GAM) for regression (Since R2021a) `compact` Reduce size of machine learning model `crossval` Cross-validate machine learning model `templateGAM` Generalized additive model (GAM) learner template (Since R2023b)
 `addInteractions` Add interaction terms to univariate generalized additive model (GAM) (Since R2021a) `resume` Resume training of generalized additive model (GAM) (Since R2021a)
 `lime` Local interpretable model-agnostic explanations (LIME) (Since R2020b) `partialDependence` Compute partial dependence (Since R2020b) `permutationImportance` Predictor importance by permutation (Since R2024a) `plotLocalEffects` Plot local effects of terms in generalized additive model (GAM) (Since R2021a) `plotPartialDependence` Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots `shapley` Shapley values (Since R2021a)
 `predict` Predict responses using generalized additive model (GAM) (Since R2021a) `loss` Regression loss for generalized additive model (GAM) (Since R2021a)
 `resubPredict` Predict responses for training data using trained regression model `resubLoss` Resubstitution regression loss
 `kfoldPredict` Predict responses for observations in cross-validated regression model `kfoldLoss` Loss for cross-validated partitioned regression model `kfoldfun` Cross-validate function for regression