GAMCR.dataset.datagam module#

class GAMCR.dataset.datagam.DataGAM(L, n_splines=10, lam=10)[source]#

Bases: object

A class connecting the PyGAM package to GAMCR.

L#

number of basis functions on which the transfer function is decomposed - it is also equal to the number of GAMs considered in our model

Type:

int

n_splines#

number of splines used for one GAM

Type:

int

lam#

regularization parameter related to the smoothing penalty in the GAM

Type:

positive float

get_params()[source]#

Return the parameters characterizing the L GAMs

get_coeffs()[source]#

Get the coefficients of the L GAMs

init_gam_from_design(X)[source]#

Initizialize the L GAMs using the design matrix X to set the knots

init_gam_from_knots(edge_knots, m_features, coeffs=None)[source]#

Initizialize the L GAMs using the knots provided as input

_modelmat(X)[source]#

Builds a model matrix out of the spline basis for each feature

get_params()[source]#

Return the parameters characterizing the L GAMs

get_coeffs()[source]#

Get the coefficients of the L GAMs

init_gam_from_design(X)[source]#

Initizialize the L GAMs using the design matrix X to set the knots

Parameters:
X array

Design matrix of the GAM compute from the method ‘get_design’. X has dimension: number of timepoints x number of features.

init_gam_from_knots(edge_knots, m_features, coeffs=None)[source]#

Initizialize the L GAMs using the knots provided as input

Parameters:
edge_knots array

Knots to use for all GAMs

m_features int

Total number of features

coeffs array, optional

If not None, the coefficients of the L GAMs are set using the coefficients provided in coeffs. coeffs should be of dimension: L x (number of columns of the matrix returned by the ‘_modelmat’ method)