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 
#>  17.94039 -27.16430   6.48247 -27.47452 -13.69680  -0.38761  -1.22001  30.83475 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>   0.30215 -18.63065  16.39218   8.87125 -97.23155  -1.49126 -10.92651 -23.86807 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  29.18998 -44.92044  37.74152 -19.99875  34.87553 -26.68253   3.78024  30.33694 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#> -21.40130  33.55208 -10.56595  -0.27057  11.16131  14.82931  -4.51163  22.65998 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>  11.46181 -13.58652  -3.38047   2.90265 -21.28012  -8.30131 -28.55850   0.95166 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#> -23.92246  -4.47288  -1.25053 -32.17234 -44.47783  -9.49752  68.61109 -63.79810 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -70.45352 -16.63528  -2.21638  10.95035  15.12118  24.10457  10.22046 -26.81201 
#>        V6       V60        V7        V8        V9 
#>  12.05005  -7.55901 -12.33045  42.90588 -29.57520 
#> 
#>     Null deviance: 190.61 on 138 degrees of freedom
#> Residual deviance: 17.38 on 94.76 degrees of freedom
#>             Score: deviance + 4.9 * df = 235.68 


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

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