Classification Logistic Regression Learner
mlr_learners_classif.logistic.Rd
Multinomial 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/basics.html#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
Examples
# Define the Learner
learner = mlr3::lrn("classif.logistic")
print(learner)
#> <LearnerClassifLogistic:classif.logistic>: Multinomial Logistic Regression
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, RWeka
#> * Predict Types: [response], prob
#> * Feature Types: logical, integer, numeric, factor, ordered
#> * Properties: missings, multiclass, twoclass
# Define a Task
task = mlr3::tsk("sonar")
# Create train and test set
ids = mlr3::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 -378.1746
#> V10 -202.1329
#> V11 41.6746
#> V12 299.8394
#> V13 58.7144
#> V14 19.7277
#> V15 133.5451
#> V16 -48.4249
#> V17 -125.8009
#> V18 -41.7955
#> V19 24.5178
#> V2 568.3739
#> V20 163.9106
#> V21 -263.4012
#> V22 89.2565
#> V23 171.9064
#> V24 -58.3812
#> V25 0.5267
#> V26 39.2007
#> V27 -160.9675
#> V28 85.0733
#> V29 -131.3811
#> V3 -1165.35
#> V30 212.9945
#> V31 -250.3026
#> V32 125.0713
#> V33 -61.5927
#> V34 -79.5477
#> V35 105.6567
#> V36 -109.29
#> V37 -134.2381
#> V38 92.5061
#> V39 41.5513
#> V4 436.3164
#> V40 -95.1261
#> V41 84.0153
#> V42 -109.0629
#> V43 65.8263
#> V44 165.9826
#> V45 12.7013
#> V46 -72.6731
#> V47 264.7556
#> V48 -25.6587
#> V49 1396.0589
#> V5 -287.0618
#> V50 -2664.0282
#> V51 -1288.7779
#> V52 624.6932
#> V53 1631.5929
#> V54 4113.6376
#> V55 -5244.6145
#> V56 -4483.7052
#> V57 2423.1323
#> V58 1736.6839
#> V59 2032.5548
#> V6 247.4875
#> V60 706.8095
#> V7 -413.4054
#> V8 -203.3378
#> V9 451.4583
#> Intercept -15.9774
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 0
#> V10 0
#> V11 1.25612850323301171E18
#> V12 1.6542305577046234E130
#> V13 3.1574555537986754E25
#> V14 369499005.5899
#> V15 9.9518674765484E57
#> V16 0
#> V17 0
#> V18 0
#> V19 4.44580742059005E10
#> V2 6.944275580658163E246
#> V20 1.532696524871794E71
#> V21 0
#> V22 5.802486461261165E38
#> V23 4.549774460458843E74
#> V24 0
#> V25 1.6933
#> V26 1.05837837794993328E17
#> V27 0
#> V28 8.848672075484736E36
#> V29 0
#> V3 0
#> V30 3.1793879084728904E92
#> V31 0
#> V32 2.0786697206346285E54
#> V33 0
#> V34 0
#> V35 7.693635651786918E45
#> V36 0
#> V37 0
#> V38 1.4958843401637921E40
#> V39 1.11040384037086861E18
#> V4 3.0889010892565085E189
#> V40 0
#> V41 3.0718690652891323E36
#> V42 0
#> V43 3.872640371969873E28
#> V44 1.2171097414669962E72
#> V45 328158.5304
#> V46 0
#> V47 9.592171123241371E114
#> V48 0
#> V49 Infinity
#> V5 0
#> V50 0
#> V51 0
#> V52 1.9990687442562595E271
#> V53 Infinity
#> V54 Infinity
#> V55 0
#> V56 0
#> V57 Infinity
#> V58 Infinity
#> V59 Infinity
#> V6 3.037035851660613E107
#> V60 9.193254548719001E306
#> V7 0
#> V8 0
#> V9 1.1636867205078952E196
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.2898551