Classification Logistic Regression Learner
Source:R/learner_stepPlr_classif_plr.R
mlr_learners_classif.stepPlr.RdLogistic regression with a quadratic penalization on the coefficient.
Calls stepPlr::plr() from stepPlr.
Parameters
| Id | Type | Default | Levels | Range |
| cp | character | aic | aic, bic | - |
| lambda | numeric | 1e-04 | \([0, \infty)\) | |
| offset.coefficients | untyped | - | - | |
| offset.subset | untyped | - | - |
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
as.data.table(mlr_learners)for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifStepPlr
Methods
Inherited methods
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()
LearnerClassifStepPlr$new()
Creates a new instance of this R6 class.
Usage
LearnerClassifStepPlr$new()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
#> 43.46051 -67.66197 25.32881 -37.08723 -43.67493 10.10522 11.33524 -14.97675
#> V16 V17 V18 V19 V2 V20 V21 V22
#> -12.25457 27.84821 -5.60292 -3.78195 -12.77573 -25.42816 36.18908 -37.95753
#> V23 V24 V25 V26 V27 V28 V29 V3
#> 18.23367 -29.14288 10.36280 23.88343 -19.17293 -22.74951 28.80175 21.94846
#> V30 V31 V32 V33 V34 V35 V36 V37
#> -35.97302 14.12725 6.72979 -9.02111 10.63640 -35.68718 22.47502 9.74649
#> V38 V39 V4 V40 V41 V42 V43 V44
#> 18.21148 -32.68545 -20.80315 36.00459 -1.64380 -39.29472 25.22495 -3.78554
#> V45 V46 V47 V48 V49 V5 V50 V51
#> -20.45448 -32.77754 45.68465 -69.70146 -41.67089 5.40899 36.89074 -29.20727
#> V52 V53 V54 V55 V56 V57 V58 V59
#> -46.34987 -46.95810 -20.49534 13.07616 2.96123 10.37814 -14.30766 -33.11624
#> V6 V60 V7 V8 V9
#> -24.80720 -37.89548 18.47151 46.93699 -22.14821
#>
#> Null deviance: 191.07 on 138 degrees of freedom
#> Residual deviance: 11.45 on 95.93 degrees of freedom
#> Score: deviance + 4.9 * df = 223.98
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.2608696