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


LearnerClassifStepPlr$new()

Creates a new instance of this R6 class.

Usage


LearnerClassifStepPlr$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 
#>  14.00939 -76.42529 -51.45497 -18.69331 -17.74580  -7.30997  21.01745 -34.80858 
#>       V16       V17       V18       V19        V2       V20       V21       V22 
#>  36.96755   4.50529  -8.13438  11.76949  -6.25317 -46.09122  44.36655 -25.58801 
#>       V23       V24       V25       V26       V27       V28       V29        V3 
#>  23.95972 -35.81040  -3.47615  27.39037 -12.45216   1.16661   2.41298  68.18515 
#>       V30       V31       V32       V33       V34       V35       V36       V37 
#> -19.90134  44.41637 -10.71450 -12.69977  18.65430  10.06888   4.05510   6.53092 
#>       V38       V39        V4       V40       V41       V42       V43       V44 
#>   9.94976 -18.44579 -21.69042  16.00202   6.52995  -6.57241  -8.60460 -22.24508 
#>       V45       V46       V47       V48       V49        V5       V50       V51 
#> -23.41055 -46.16174  53.79853 -39.68587 -60.60654 -55.87175  60.91967  -7.27224 
#>       V52       V53       V54       V55       V56       V57       V58       V59 
#> -22.76869 -17.52785 -18.44243   8.69542  23.19953  25.91600 -11.26610 -24.78454 
#>        V6       V60        V7        V8        V9 
#>  23.43728 -16.52327  14.21266  16.55202  22.55933 
#> 
#>     Null deviance: 191.82 on 138 degrees of freedom
#> Residual deviance: 12.46 on 95.29 degrees of freedom
#>             Score: deviance + 4.9 * df = 228.16 


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

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