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', 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 
#>  15.29701 -56.17509   2.97135   3.75887  -6.38097 -45.39492  45.47562 -20.71881 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>  23.50993   5.10827  19.57971 -44.64033 -67.88538  17.63166 -13.59176  -6.06553 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  27.23736 -38.73642  24.02468  13.14736 -46.25590  44.91472 -30.00767  18.31448 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#>  -2.04691  49.59281 -45.54456  21.80360  -5.22535 -12.51219  17.52595  12.59628 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>  -0.06353 -14.90366 -31.21407  13.89638   6.93352  -3.44299  -4.23976 -26.36194 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#>   0.74103  12.25145  -5.67375 -64.74474 -47.15338 -28.88413  38.48159 -15.41344 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -26.65661 -32.08613  -3.65562 -17.51374  -1.86563  -4.72993 -14.29921 -13.08665 
#>        V6       V60        V7        V8        V9 
#>  -1.40892   0.29685  32.30362   8.38128 -33.77257 
#> 
#>     Null deviance: 187.42 on 138 degrees of freedom
#> Residual deviance: 9.36 on 96.83 degrees of freedom
#>             Score: deviance + 4.9 * df = 217.44 


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

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