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


Method new()

Creates a new instance of this R6 class.

Usage


Method 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'

# 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 
#>   7.83944 -53.30613  21.73389 -23.07557  -4.83668 -13.61329  21.23878 -22.70139 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>  24.96828  19.64592 -18.95864  -7.40389  -0.58772   1.72990   2.12060  -5.24561 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  12.80958 -29.14748  25.11416 -11.10751  -4.74611   5.62026   9.83814 101.67203 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#> -36.74626  55.47357 -39.99495  17.34949  12.23398 -20.87569  17.62340   7.80340 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>  -7.00122  -5.78336 -96.63365  21.73165 -10.89288   1.22422   3.27452 -13.69201 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#>  -0.77063  -8.48262  -2.14851 -44.30262 -42.73198  18.86789  94.57159 -35.93716 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -40.36407 -13.19256 -31.77900 -16.52775   6.00983  12.41239 -29.08128 -46.52846 
#>        V6       V60        V7        V8        V9 
#> -22.26047 -35.34253  30.73011   5.98756 -22.63066 
#> 
#>     Null deviance: 192.69 on 138 degrees of freedom
#> Residual deviance: 16.4 on 92.72 degrees of freedom
#>             Score: deviance + 4.9 * df = 244.74 


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

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