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 546.9777
#> V10 -76.5716
#> V11 -3.2155
#> V12 286.8514
#> V13 -77.0414
#> V14 101.4057
#> V15 60.6781
#> V16 -136.4864
#> V17 -104.7509
#> V18 182.4691
#> V19 -107.6795
#> V2 -145.0619
#> V20 113.0661
#> V21 -15.6865
#> V22 -59.1842
#> V23 86.7856
#> V24 29.8588
#> V25 -37.5845
#> V26 30.6824
#> V27 -1.858
#> V28 43.8203
#> V29 -122.3782
#> V3 -705.4569
#> V30 231.1773
#> V31 -261.1032
#> V32 19.0317
#> V33 164.1098
#> V34 -210.2673
#> V35 299.4409
#> V36 -244.8075
#> V37 63.7461
#> V38 -112.846
#> V39 200.5317
#> V4 127.2381
#> V40 -161.4178
#> V41 13.2935
#> V42 -15.724
#> V43 -14.2337
#> V44 96.4133
#> V45 -86.7176
#> V46 142.7075
#> V47 60.6169
#> V48 176.3769
#> V49 848.6494
#> V5 -213.0398
#> V50 -2001.824
#> V51 1070.84
#> V52 2123.8501
#> V53 1014.3561
#> V54 220.1159
#> V55 -1012.1529
#> V56 358.7561
#> V57 -2785.4128
#> V58 1351.9463
#> V59 1260.4131
#> V6 321.2336
#> V60 1219.8387
#> V7 -387.6984
#> V8 -57.7748
#> V9 160.1755
#> Intercept -150.0531
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 3.5430468204178025E237
#> V10 0
#> V11 0.0401
#> V12 3.7843293129266773E124
#> V13 0
#> V14 1.096324969651127E44
#> V15 2.249968413205226E26
#> V16 0
#> V17 0
#> V18 1.7591542633330597E79
#> V19 0
#> V2 0
#> V20 1.270583686811129E49
#> V21 0
#> V22 0
#> V23 4.903549553320891E37
#> V24 9.279289378430262E12
#> V25 0
#> V26 2.1143714318277066E13
#> V27 0.156
#> V28 1.0737438632098636E19
#> V29 0
#> V3 0
#> V30 2.5061533337566248E100
#> V31 0
#> V32 184221713.6755
#> V33 1.8705856102567994E71
#> V34 0
#> V35 1.1105783826619472E130
#> V36 0
#> V37 4.8369760565545275E27
#> V38 0
#> V39 1.2297674697007022E87
#> V4 1.8146502644658E55
#> V40 0
#> V41 593355.9091
#> V42 0
#> V43 0
#> V44 7.443111256524907E41
#> V45 0
#> V46 9.486013281505841E61
#> V47 2.1163900826576165E26
#> V48 3.976449100977918E76
#> V49 Infinity
#> V5 0
#> V50 0
#> V51 Infinity
#> V52 Infinity
#> V53 Infinity
#> V54 3.9365391315872605E95
#> V55 0
#> V56 6.394207852204964E155
#> V57 0
#> V58 Infinity
#> V59 Infinity
#> V6 3.2357754034463443E139
#> V60 Infinity
#> V7 0
#> V8 0
#> V9 3.658658965919883E69
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.2318841