Description Usage Arguments Details Value Examples
ab_cvGAM is an internal tuning function called by agecurveAb
and tmleAb
that selects degrees of freedom for natural splines in a GAM model using cross-validation
1 2 |
Y |
The outcome. Must be a numeric vector. |
X |
A matrix of features that predict Y, usually a data.frame. |
id |
An optional cluster or repeated measures id variable. For cross-validation splits, |
family |
Model family (gaussian for continuous outcomes, binomial for binary outcomes) |
SL.library |
SuperLearner library |
cvControl |
Optional list to control cross-valiation (see |
print |
logical. print messages? Defaults to FALSE |
df |
a sequence of degrees of freedom to control the smoothness of natural splines in the GAM model. Defaults to 2:6 |
ab_cvGAM
is an internal function called by agecurveAb
or tmleAb
if SL.gam() is included in the algorithm library. It performs an addition pre-screen step of selecting the optimal spline degress of freedom using cross validation. The default is to search over degrees 2,3,...10, which is usually pretty good. This additional selection step enables you to tune the smoothing parameter. Cross-validated risks are estimated using SuperLearner
.
returns a list with updated SuperLearner library, the optimal node size, and cvRisks
1 | # TBD
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.