Classification Logistic Regression Learner
Source:R/learner_RWeka_classif_logistic.R
mlr_learners_classif.logistic.RdMultinomial Logistic Regression model with a ridge estimator.
Calls RWeka::Logistic() from RWeka.
Custom mlr3 parameters
output_debug_info:original id: output-debug-info
do_not_check_capabilities:original id: do-not-check-capabilities
num_decimal_places:original id: num-decimal-places
batch_size:original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
Parameters
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| C | logical | FALSE | TRUE, FALSE | - |
| R | numeric | - | \((-\infty, \infty)\) | |
| M | integer | -1 | \((-\infty, \infty)\) | |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | \([1, \infty)\) | |
| batch_size | integer | 100 | \([1, \infty)\) | |
| options | untyped | NULL | - |
References
le Cessie, S., van Houwelingen, J.C. (1992). “Ridge Estimators in Logistic Regression.” Applied Statistics, 41(1), 191-201.
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 -> LearnerClassifLogistic
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()
LearnerClassifLogistic$new()
Creates a new instance of this R6 class.
Usage
LearnerClassifLogistic$new()LearnerClassifLogistic$marshal()
Marshal the learner's model.
Arguments
...(any)
Additional arguments passed tomlr3::marshal_model().
LearnerClassifLogistic$unmarshal()
Unmarshal the learner's model.
Arguments
...(any)
Additional arguments passed tomlr3::unmarshal_model().
Examples
# Define the Learner
learner = lrn("classif.logistic")
print(learner)
#>
#> ── <LearnerClassifLogistic> (classif.logistic): Multinomial Logistic Regression
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3 and RWeka
#> • Predict Types: [response] and prob
#> • Feature Types: logical, integer, numeric, factor, and ordered
#> • Encapsulation: none (fallback: -)
#> • Properties: marshal, missings, multiclass, and twoclass
#> • Other settings: use_weights = 'error', 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)
#> Logistic Regression with ridge parameter of 1.0E-8
#> Coefficients...
#> Class
#> Variable M
#> ===================================
#> V1 996.1854
#> V10 14.4959
#> V11 -3.9687
#> V12 59.5403
#> V13 62.2916
#> V14 24.4453
#> V15 50.3227
#> V16 -117.7473
#> V17 -20.9642
#> V18 119.0492
#> V19 -62.8601
#> V2 0.8245
#> V20 16.1178
#> V21 -9.0545
#> V22 -1.1221
#> V23 83.7492
#> V24 35.0814
#> V25 -12.2374
#> V26 -102.843
#> V27 32.809
#> V28 9.374
#> V29 -24.8406
#> V3 -624.815
#> V30 135.5337
#> V31 -191.4164
#> V32 104.1111
#> V33 -62.1764
#> V34 -12.0818
#> V35 90.5868
#> V36 -137.5497
#> V37 15.6386
#> V38 26.1829
#> V39 151.2078
#> V4 282.393
#> V40 -173.4116
#> V41 80.4314
#> V42 94.7755
#> V43 -36.4225
#> V44 118.9468
#> V45 -76.5258
#> V46 3.3493
#> V47 -18.6596
#> V48 281.3114
#> V49 376.1313
#> V5 -131.5588
#> V50 -1463.3855
#> V51 1566.3752
#> V52 689.7354
#> V53 631.5023
#> V54 -309.5018
#> V55 -1644.8424
#> V56 -23.5956
#> V57 -815.8579
#> V58 -497.4338
#> V59 585.3777
#> V6 267.7297
#> V60 -1355.4233
#> V7 -242.9268
#> V8 -209.8581
#> V9 195.2721
#> Intercept -104.7728
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 Infinity
#> V10 1974557.5742
#> V11 0.0189
#> V12 7.211794544946223E25
#> V13 1.1295138948077017E27
#> V14 4.135001983229258E10
#> V15 7.159549041840953E21
#> V16 0
#> V17 0
#> V18 5.039569586564117E51
#> V19 0
#> V2 2.2808
#> V20 9997071.5842
#> V21 0.0001
#> V22 0.3256
#> V23 2.3540625018305564E36
#> V24 1.7204546459722438E15
#> V25 0
#> V26 0
#> V27 1.7732144678197744E14
#> V28 11777.6595
#> V29 0
#> V3 0
#> V30 7.269823894063389E58
#> V31 0
#> V32 1.640138950146302E45
#> V33 0
#> V34 0
#> V35 2.1946452082803737E39
#> V36 0
#> V37 6191156.7949
#> V38 2.3502192819364737E11
#> V39 4.663558862030888E65
#> V4 4.38242346257735E122
#> V40 0
#> V41 8.528972532820742E34
#> V42 1.4470485778457949E41
#> V43 0
#> V44 4.5490649207781016E51
#> V45 0
#> V46 28.4825
#> V47 0
#> V48 1.4858244871752926E122
#> V49 2.247837372472301E163
#> V5 0
#> V50 0
#> V51 Infinity
#> V52 3.53424940654917E299
#> V53 1.8111478892607974E274
#> V54 0
#> V55 0
#> V56 0
#> V57 0
#> V58 0
#> V59 1.6838411330794765E254
#> V6 1.8772851849086228E116
#> V60 0
#> V7 0
#> V8 0
#> V9 6.391302856389469E84
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.2898551