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 197.2081
#> V10 -143.2476
#> V11 55.9649
#> V12 15.7131
#> V13 93.2959
#> V14 24.1427
#> V15 2.7795
#> V16 -69.9337
#> V17 -43.8591
#> V18 26.507
#> V19 76.1924
#> V2 524.9679
#> V20 -68.3898
#> V21 83.6101
#> V22 5.8879
#> V23 -43.0188
#> V24 191.2556
#> V25 -118.2898
#> V26 1.28
#> V27 130.8163
#> V28 -157.1554
#> V29 61.9809
#> V3 -1089.8949
#> V30 145.0638
#> V31 -244.9563
#> V32 115.276
#> V33 134.8127
#> V34 -218.5446
#> V35 141.5508
#> V36 -27.3406
#> V37 -165.1126
#> V38 18.337
#> V39 319.0723
#> V4 703.8988
#> V40 -342.7282
#> V41 61.8473
#> V42 174.0126
#> V43 -18.2089
#> V44 -188.363
#> V45 217.5449
#> V46 -125.4985
#> V47 -19.5983
#> V48 176.3217
#> V49 977.8711
#> V5 -386.3004
#> V50 -2416.9854
#> V51 -403.2271
#> V52 1474.0626
#> V53 1241.0545
#> V54 433.8027
#> V55 -750.8291
#> V56 374.1162
#> V57 1382.9285
#> V58 259.6347
#> V59 -1909.8469
#> V6 210.9623
#> V60 3008.4645
#> V7 -281.6007
#> V8 -107.3239
#> V9 283.4351
#> Intercept -158.5085
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 4.429735196942941E85
#> V10 0
#> V11 2.0195927390940288E24
#> V12 6669692.1701
#> V13 3.2953522343083397E40
#> V14 3.055294719900351E10
#> V15 16.1106
#> V16 0
#> V17 0
#> V18 3.249545501768803E11
#> V19 1.2300853855071186E33
#> V2 9.78747705771944E227
#> V20 0
#> V21 2.048388970260335E36
#> V22 360.6589
#> V23 0
#> V24 1.151419261772165E83
#> V25 0
#> V26 3.5968
#> V27 6.498014563514905E56
#> V28 0
#> V29 8.278809260146215E26
#> V3 0
#> V30 1.0009453712161397E63
#> V31 0
#> V32 1.1580777611915271E50
#> V33 3.535094647479275E58
#> V34 0
#> V35 2.983612646598073E61
#> V36 0
#> V37 0
#> V38 91974648.3118
#> V39 3.726958146964465E138
#> V4 5.0044628444194674E305
#> V40 0
#> V41 7.243283021771173E26
#> V42 3.738485991512341E75
#> V43 0
#> V44 0
#> V45 3.0099486357770222E94
#> V46 0
#> V47 0
#> V48 3.763157898543773E76
#> V49 Infinity
#> V5 0
#> V50 0
#> V51 0
#> V52 Infinity
#> V53 Infinity
#> V54 2.5009931528722337E188
#> V55 0
#> V56 2.996268706283128E162
#> V57 Infinity
#> V58 5.726891031953359E112
#> V59 0
#> V6 4.166428884026504E91
#> V60 Infinity
#> V7 0
#> V8 0
#> V9 1.2425274520952712E123
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.3188406