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 
#>  48.81102 -34.86276  -3.87769 -18.10390 -32.31541  28.28238 -19.65612   9.40508 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>  -3.65618   8.22404  28.71070 -18.50278 -44.72592 -17.81919  10.02563 -22.07248 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>   1.32853 -10.62211 -26.19291  30.94964  -2.87892  -4.58071  -1.50441  36.40828 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#> -29.53764  42.15910 -28.69795  -3.76851  37.78473 -37.60259  39.49892 -15.80644 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>   8.73275 -24.53778  -3.39756  43.58015 -18.62532 -24.32943 -27.74819  20.16380 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#> -34.31529  29.17433  -5.41155 -79.59511  10.20202 -32.44793  51.38312 -43.70769 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -30.62513 -20.67535 -24.78416  16.15888  -5.49252  15.44474   4.60678 -30.79768 
#>        V6       V60        V7        V8        V9 
#>   6.02957 -16.93192  -6.17249  59.35961 -59.71084 
#> 
#>     Null deviance: 192.52 on 138 degrees of freedom
#> Residual deviance: 12.48 on 97.06 degrees of freedom
#>             Score: deviance + 4.9 * df = 219.45 


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

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