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:
- smoother
additivesmootherinstance smoother providing the basis for the smooth terms of the model
- alphas
listofiterables list of alpha for smooths. The product space will be used as alpha grid for cross-validation
- gam
modelclass model class for creating a model with k-fold training data
- cost
function cost function for the prediction error
- endog
ndarray dependent (response) variable of the model
- exog
ndarrayorNone design matrix of the linear (non-smooth) terms of the model
- cv_iterator
instanceofcross-validationiterator iterator used to split the data into train and test indices
- smoother
- Attributes:
- cost
function cost function for the prediction error
- smoother
additivesmootherinstance smoother providing the basis for the smooth terms of the model
- gam
modelclass model class for creating a model with k-fold training data
- alphas
listofiterables list of alpha for smooths
- alphas_grid
listoftuples product space of
alphassearched during cross-validation- endog
ndarray dependent (response) variable of the model
- exog
ndarrayorNone design matrix of the linear (non-smooth) terms of the model
- cv_iterator
instanceofcross-validationiterator iterator used to split the data into train and test indices
- cv_error
ndarray mean cross-validation error for each element of
alphas_grid- cv_std
ndarray standard deviation of the cross-validation error for each element of
alphas_grid- alpha_cv
tupleorNone element of
alphas_gridwith the smallest cross-validation error
- cost
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