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 
#>  12.93385 -27.05542 -44.46229  -8.20117 -48.03899  48.17587 -12.51129  -4.20366 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>  11.22330   5.89604   8.34683  -7.71260 -10.11551 -10.32831   7.18283 -16.76942 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  13.67445 -26.37687  -2.67571  25.33311 -20.89636  16.69973  -6.06017  45.31204 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#> -26.50120  50.23910 -24.87351  -9.82022  24.78767 -18.45828  13.51347  10.38102 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>   2.65329 -24.36309 -38.68518  14.41392   9.00869 -18.40421  16.09022   4.43117 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#> -36.46955 -29.90965  58.12874 -62.67466 -85.00219  -3.11702 100.90196 -15.37539 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#>  -9.18169 -26.74073 -22.48740  19.69270  -4.11299  33.53332 -10.90596 -24.82123 
#>        V6       V60        V7        V8        V9 
#> -17.64443 -25.48497  75.97021  12.89623  21.81864 
#> 
#>     Null deviance: 191.07 on 138 degrees of freedom
#> Residual deviance: 15.5 on 93.63 degrees of freedom
#>             Score: deviance + 4.9 * df = 239.4 


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

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