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 1043.1882
#> V10 -285.4725
#> V11 210.8132
#> V12 150.152
#> V13 -104.9119
#> V14 4.5768
#> V15 34.7324
#> V16 -99.3379
#> V17 -175.2553
#> V18 116.9217
#> V19 164.3546
#> V2 245.1175
#> V20 -115.1234
#> V21 -66.6106
#> V22 65.3535
#> V23 33.7332
#> V24 -24.9186
#> V25 55.4391
#> V26 -122.6591
#> V27 41.7222
#> V28 103.9895
#> V29 -113.1295
#> V3 -724.0132
#> V30 145.4111
#> V31 -289.2378
#> V32 27.3191
#> V33 78.4065
#> V34 -16.0375
#> V35 -12.9014
#> V36 -80.1963
#> V37 56.3388
#> V38 4.5486
#> V39 -49.1749
#> V4 -169.9983
#> V40 -72.6491
#> V41 78.5428
#> V42 35.9028
#> V43 -193.8935
#> V44 39.0333
#> V45 108.6407
#> V46 112.3359
#> V47 -47.1749
#> V48 107.0698
#> V49 819.1244
#> V5 133.6127
#> V50 -2128.1372
#> V51 2370.3963
#> V52 2084.5147
#> V53 28.303
#> V54 -287.2968
#> V55 -2492.7488
#> V56 861.2257
#> V57 653.9229
#> V58 1367.4831
#> V59 294.1147
#> V6 -109.3283
#> V60 -514.5436
#> V7 -90.1457
#> V8 -20.1802
#> V9 195.7181
#> Intercept 12.2483
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 Infinity
#> V10 0
#> V11 3.5892683950378365E91
#> V12 1.6225340433521515E65
#> V13 0
#> V14 97.199
#> V15 1.2135913709487448E15
#> V16 0
#> V17 0
#> V18 6.004383469818497E50
#> V19 2.389385701849323E71
#> V2 2.8390503040127025E106
#> V20 0
#> V21 0
#> V22 2.41357261322611E28
#> V23 4.4684278074238244E14
#> V24 0
#> V25 1.1936760423219313E24
#> V26 0
#> V27 1.31737422266482714E18
#> V28 1.4522934927721234E45
#> V29 0
#> V3 0
#> V30 1.4165186078210127E63
#> V31 0
#> V32 7.32013592183743E11
#> V33 1.1258875181632597E34
#> V34 0
#> V35 0
#> V36 0
#> V37 2.9350631267598805E24
#> V38 94.4969
#> V39 0
#> V4 0
#> V40 0
#> V41 1.2903740926854087E34
#> V42 3.912080187980613E15
#> V43 0
#> V44 8.952916706351616E16
#> V45 1.5207086746586878E47
#> V46 6.121654358195916E48
#> V47 0
#> V48 3.1610688338184634E46
#> V49 Infinity
#> V5 1.064826050566388E58
#> V50 0
#> V51 Infinity
#> V52 Infinity
#> V53 1.9580404117821165E12
#> V54 0
#> V55 0
#> V56 Infinity
#> V57 9.88833198016503E283
#> V58 Infinity
#> V59 5.399798759706362E127
#> V6 0
#> V60 0
#> V7 0
#> V8 0
#> V9 9.984071025476303E84
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.3043478