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 
#>  25.88178 -36.28489 -18.53667   4.91921 -32.20638 -12.11987  11.25293 -12.85493 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>   2.15714  44.52366 -50.03531  30.04119  -8.37659 -29.63866  34.11851 -45.05234 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  36.96801 -46.09762  27.57466 -12.10776   9.02244  -1.53938  -6.24636  36.02384 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#> -13.37686  31.93726  -8.97739 -15.49207  30.16844 -22.64988  -5.66996  32.28070 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#> -11.09200 -15.31623  17.23616  22.92826   7.88202 -29.29638  22.62138 -27.31655 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#>   0.75443   3.33962  -9.99599 -28.41767 -93.51789 -11.26374  51.13343 -58.74726 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -68.12618 -38.18175 -33.43955  27.05057   7.17539  35.85881 -11.92828  -1.80549 
#>        V6       V60        V7        V8        V9 
#>  -9.01942  16.38792  15.44285  51.91161 -37.45649 
#> 
#>     Null deviance: 191.07 on 138 degrees of freedom
#> Residual deviance: 14.68 on 94.06 degrees of freedom
#>             Score: deviance + 4.9 * df = 236.44 


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

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