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:

Intercept()

An intercept term.

Linear([feature, penalty, by, constraint])

A linear term.

Categorical([feature, penalty, by, ...])

A Categorial term.

Spline([feature, penalty, l2_penalty, by, ...])

A Spline term.

Tensor(splines, *[, by])

A Tensor term.

TermList#

A TermList is a subclass of list, designed to hold terms.

TermList([data])

Distributions#

Normal([scale])

Normal Distribution

Poisson([scale])

Poisson Distribution

Binomial([trials, scale])

Binomial Distribution

Gamma([scale])

Gamma Distribution

InvGauss([scale])

Inverse Gaussian Distribution

Exponential([scale])

Exponential Distribution

Bernoulli([scale])

Bernoulli Distribution

Models#

GAM([terms, distribution, link, ...])

Initialize a Generalized Additive Model (GAM).

ExpectileGAM([terms, expectile, ...])

Initialize an ExpectileGAM.