pyGAM Logo

Contents:

  • Quick Start
    • Install pyGAM
      • Pip
      • Conda
      • Bleeding edge
      • Get pandas and matplotlib
    • Fit a Model
    • Automatically tune the model
    • Partial Dependence Functions
  • A Tour of pyGAM
    • Introduction
    • Generalized Additive Models, in general
      • Distribution:
      • Link function:
      • Functional Form:
      • in Practice…
    • Terms and Interactions
    • Regression
    • Classification
    • Poisson and Histogram Smoothing
    • Expectiles
    • Custom Models
    • Penalties / Constraints
    • API
    • Current Features
      • Models
      • Terms
      • Distributions
      • Link Functions
      • Callbacks
      • Linear Extrapolation
    • References
  • User API
    • Generalized Additive Model Classes
      • GAM
      • LinearGAM
      • GammaGAM
      • InvGaussGAM
      • LogisticGAM
      • PoissonGAM
      • ExpectileGAM
    • Terms
      • Linear Term
      • Spline Term
      • Factor Term
      • Tensor Term
  • Developer API
    • Terms
    • Distributions
    • Links
    • Callbacks
    • Penalties
pyGAM
  • Docs »
  • Developer API »
  • Links
  • Edit on GitHub
Next Previous

Links¶

class pygam.links.Link(name=None)¶

Bases: pygam.core.Core

class pygam.links.IdentityLink¶

Bases: pygam.links.Link

gradient(mu, dist)¶

derivative of the link function wrt mu

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

grad

Return type:

np.array of length n

link(mu, dist)¶

glm link function this is useful for going from mu to the linear prediction

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

lp

Return type:

np.array of length n

mu(lp, dist)¶

glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu

Parameters:
  • lp (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

mu

Return type:

np.array of length n

class pygam.links.InvSquaredLink¶

Bases: pygam.links.Link

gradient(mu, dist)¶

derivative of the link function wrt mu

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

grad

Return type:

np.array of length n

link(mu, dist)¶

glm link function this is useful for going from mu to the linear prediction

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

lp

Return type:

np.array of length n

mu(lp, dist)¶

glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu

Parameters:
  • lp (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

mu

Return type:

np.array of length n

class pygam.links.LogitLink¶

Bases: pygam.links.Link

gradient(mu, dist)¶

derivative of the link function wrt mu

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

grad

Return type:

np.array of length n

link(mu, dist)¶

glm link function this is useful for going from mu to the linear prediction

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

lp

Return type:

np.array of length n

mu(lp, dist)¶

glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu

Parameters:
  • lp (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

mu

Return type:

np.array of length n

class pygam.links.LogLink¶

Bases: pygam.links.Link

gradient(mu, dist)¶

derivative of the link function wrt mu

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

grad

Return type:

np.array of length n

link(mu, dist)¶

glm link function this is useful for going from mu to the linear prediction

Parameters:
  • mu (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

lp

Return type:

np.array of length n

mu(lp, dist)¶

glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu

Parameters:
  • lp (array-like of legth n) –
  • dist (Distribution instance) –
Returns:

mu

Return type:

np.array of length n

Next Previous

© Copyright 2018, Daniel Servén and Charlie Brummitt Revision b57b4cf8.

Built with Sphinx using a theme provided by Read the Docs.