Skip to contents

Logistic regression with a quadratic penalization on the coefficient. Calls stepPlr::plr() from stepPlr.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.stepPlr")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

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

  • Required Packages: mlr3, stepPlr

Parameters

IdTypeDefaultLevelsRange
cpcharacteraicaic, bic-
lambdanumeric1e-04\([0, \infty)\)
offset.coefficientsuntyped--
offset.subsetuntyped--

References

Park, Young M, Hastie, Trevor (2007). “Penalized logistic regression for detecting gene interactions.” Biostatistics, 9(1), 30-50. ISSN 1465-4644. doi:10.1093/biostatistics/kxm010 . https://doi.org/10.1093/biostatistics/kxm010.

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifStepPlr

Methods

Inherited methods


LearnerClassifStepPlr$new()

Creates a new instance of this R6 class.

Usage


LearnerClassifStepPlr$clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifStepPlr$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.stepPlr")
print(learner)
#> 
#> ── <LearnerClassifStepPlr> (classif.stepPlr): Logistic Regression with a L2 Pena
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3 and stepPlr
#> • Predict Types: [response] and prob
#> • Feature Types: logical, integer, and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties: twoclass and weights
#> • Other settings: use_weights = 'use', predict_raw = 'FALSE'

# Define a Task
task = tsk("sonar")

# Create train and test set
ids = partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)
#> 
#> Call:
#> stepPlr::plr(x = data, y = y)
#> 
#> Coefficients:
#> Intercept        V1       V10       V11       V12       V13       V14       V15 
#>  34.23394 -87.35737  19.25826 -64.61532  -0.59982  26.61487   1.94540  -0.76132 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>  -1.49432  -1.98624  16.20116 -10.65752 -46.02691   9.53953 -16.75273 -14.18970 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  14.16991 -33.45594  15.01774  21.05745 -23.68898  22.36150 -29.43951  39.55585 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#>  -2.98056  23.12448 -16.81593   3.40309  -6.04873  10.70107   0.41640  18.68118 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>   2.81654 -27.30297 -12.85996  24.88710 -20.57133  -1.73711 -23.34781   2.67946 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#> -20.33932  -3.82953   8.51185 -68.46104 -21.19146 -19.99689  96.64479 -32.85502 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -45.87260 -35.47488  24.31637  12.15387  11.36754  22.67379  -6.98591 -19.82143 
#>        V6       V60        V7        V8        V9 
#> -26.84015 -12.93742  28.90055  52.17228 -30.91706 
#> 
#>     Null deviance: 192.63 on 138 degrees of freedom
#> Residual deviance: 12.57 on 94.95 degrees of freedom
#>             Score: deviance + 4.9 * df = 229.93 


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> classif.ce 
#>  0.2463768