Skip to contents

Generalized linear models with elastic net regularization. Calls glmnet::cv.glmnet() from package glmnet.

Details

This learner returns two prediction types:

  1. lp: a vector of linear predictors (relative risk scores), one per observation. Calculated using glmnet::predict.cv.glmnet().

  2. distr: a survival matrix in two dimensions, where observations are represented in rows and time points in columns. Calculated using glmnet::survfit.cv.glmnet(). Parameters stype and ctype relate to how lp predictions are transformed into survival predictions and are described in survival::survfit.coxph(). By default the Breslow estimator is used.

Custom mlr3 parameters

  • family is set to "cox" and cannot be changed.

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("surv.cv_glmnet")
lrn("surv.cv_glmnet")

Meta Information

  • Task type: “surv”

  • Predict Types: “crank”, “distr”, “lp”

  • Feature Types: “logical”, “integer”, “numeric”

  • Required Packages: mlr3, mlr3proba, mlr3extralearners, glmnet

Parameters

IdTypeDefaultLevelsRange
alignmentcharacterlambdalambda, fraction-
alphanumeric1\([0, 1]\)
bignumeric9.9e+35\((-\infty, \infty)\)
devmaxnumeric0.999\([0, 1]\)
dfmaxinteger-\([0, \infty)\)
epsnumeric1e-06\([0, 1]\)
epsnrnumeric1e-08\([0, 1]\)
excludeuntyped--
exmxnumeric250\((-\infty, \infty)\)
fdevnumeric1e-05\([0, 1]\)
foldiduntypedNULL-
gammauntyped--
groupedlogicalTRUETRUE, FALSE-
interceptlogicalTRUETRUE, FALSE-
keeplogicalFALSETRUE, FALSE-
lambdauntyped--
lambda.min.rationumeric-\([0, 1]\)
lower.limitsuntyped-Inf-
maxitinteger100000\([1, \infty)\)
mnlaminteger5\([1, \infty)\)
mxitinteger100\([1, \infty)\)
mxitnrinteger25\([1, \infty)\)
nfoldsinteger10\([3, \infty)\)
nlambdainteger100\([1, \infty)\)
offsetuntypedNULL-
newoffsetuntyped--
parallellogicalFALSETRUE, FALSE-
penalty.factoruntyped--
pmaxinteger-\([0, \infty)\)
pminnumeric1e-09\([0, 1]\)
precnumeric1e-10\((-\infty, \infty)\)
predict.gammanumericgamma.1se\((-\infty, \infty)\)
relaxlogicalFALSETRUE, FALSE-
snumericlambda.1se\([0, \infty)\)
standardizelogicalTRUETRUE, FALSE-
standardize.responselogicalFALSETRUE, FALSE-
threshnumeric1e-07\([0, \infty)\)
trace.itinteger0\([0, 1]\)
type.gaussiancharacter-covariance, naive-
type.logisticcharacterNewtonNewton, modified.Newton-
type.measurecharacterdeviancedeviance, C-
type.multinomialcharacterungroupedungrouped, grouped-
upper.limitsuntypedInf-
stypeinteger2\([1, 2]\)
ctypeinteger-\([1, 2]\)

References

Friedman J, Hastie T, Tibshirani R (2010). “Regularization Paths for Generalized Linear Models via Coordinate Descent.” Journal of Statistical Software, 33(1), 1--22. doi:10.18637/jss.v033.i01 .

See also

Author

be-marc

Super classes

mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvCVGlmnet

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method selected_features()

Returns the set of selected features as reported by glmnet::predict.glmnet() with type set to "nonzero".

Usage

LearnerSurvCVGlmnet$selected_features(lambda = NULL)

Arguments

lambda

(numeric(1))
Custom lambda, defaults to the active lambda depending on parameter set.

Returns

(character()) of feature names.


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerSurvCVGlmnet$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

learner = mlr3::lrn("surv.cv_glmnet")
print(learner)
#> <LearnerSurvCVGlmnet:surv.cv_glmnet>: Regularized Generalized Linear Model
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3proba, mlr3extralearners, glmnet
#> * Predict Types:  [crank], distr, lp
#> * Feature Types: logical, integer, numeric
#> * Properties: selected_features, weights

# available parameters:
learner$param_set$ids()
#>  [1] "alignment"            "alpha"                "big"                 
#>  [4] "devmax"               "dfmax"                "eps"                 
#>  [7] "epsnr"                "exclude"              "exmx"                
#> [10] "fdev"                 "foldid"               "gamma"               
#> [13] "grouped"              "intercept"            "keep"                
#> [16] "lambda"               "lambda.min.ratio"     "lower.limits"        
#> [19] "maxit"                "mnlam"                "mxit"                
#> [22] "mxitnr"               "nfolds"               "nlambda"             
#> [25] "offset"               "newoffset"            "parallel"            
#> [28] "penalty.factor"       "pmax"                 "pmin"                
#> [31] "prec"                 "predict.gamma"        "relax"               
#> [34] "s"                    "standardize"          "standardize.response"
#> [37] "thresh"               "trace.it"             "type.gaussian"       
#> [40] "type.logistic"        "type.measure"         "type.multinomial"    
#> [43] "upper.limits"         "stype"                "ctype"