statsmodels.gam.gam_cross_validation.gam_cross_validation.MultivariateGAMCVPath#

class statsmodels.gam.gam_cross_validation.gam_cross_validation.MultivariateGAMCVPath(smoother, alphas, gam, cost, endog, exog, cv_iterator)[source]#

K-fold cross-validation for GAM

Parameters:
smootheradditive smoother instance

smoother providing the basis for the smooth terms of the model

alphaslist of iterables

list of alpha for smooths. The product space will be used as alpha grid for cross-validation

gammodel class

model class for creating a model with k-fold training data

costfunction

cost function for the prediction error

endogndarray

dependent (response) variable of the model

exogndarray or None

design matrix of the linear (non-smooth) terms of the model

cv_iteratorinstance of cross-validation iterator

iterator used to split the data into train and test indices

Attributes:
costfunction

cost function for the prediction error

smootheradditive smoother instance

smoother providing the basis for the smooth terms of the model

gammodel class

model class for creating a model with k-fold training data

alphaslist of iterables

list of alpha for smooths

alphas_gridlist of tuples

product space of alphas searched during cross-validation

endogndarray

dependent (response) variable of the model

exogndarray or None

design matrix of the linear (non-smooth) terms of the model

cv_iteratorinstance of cross-validation iterator

iterator used to split the data into train and test indices

cv_errorndarray

mean cross-validation error for each element of alphas_grid

cv_stdndarray

standard deviation of the cross-validation error for each element of alphas_grid

alpha_cvtuple or None

element of alphas_grid with the smallest cross-validation error

Methods

fit(**kwargs)

Perform the cross-validation search over the alphas grid

Warning

The API of this class is preliminary and will change.

Methods

fit(**kwargs)

Perform the cross-validation search over the alphas grid