API#
This page contains API documentation for the classes.
Terms#
Terms are used in GAMs to model the features.
For instance, we can use Spline and Categorical as follows:
terms = Spline("age") + Categorical("sex")
This constructs a TermList, which can be passed to a GAM.
model = GAM(terms)
Here are all the available terms:
An intercept term. |
|
|
A linear term. |
|
A Categorial term. |
|
A Spline term. |
|
A Tensor term. |
TermList#
A TermList is a subclass of list, designed to hold terms.
|
Links#
Link functions relate linear predictions \(\eta_i = X_i \beta\) to the expected values \(\mu_i\) of an exponential family distribution.
For instance, if you believe the features multiply together to create \(\mu_i\), you can model this with the Log link as
This implies that \(\mu_i = \exp(X_i \beta) = \exp(X_{ij} \beta_j)\)
Distributions#
Models#
|
Initialize a Generalized Additive Model (GAM). |
|
Initialize an ExpectileGAM. |