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 161.3176
#> V10 -58.6489
#> V11 36.8415
#> V12 162.091
#> V13 69.6851
#> V14 -67.2221
#> V15 55.0254
#> V16 30.1499
#> V17 -49.8021
#> V18 30.2913
#> V19 -104.7418
#> V2 -221.2751
#> V20 84.9947
#> V21 -31.8445
#> V22 -27.1124
#> V23 25.4347
#> V24 107.2497
#> V25 -14.7369
#> V26 -71.0157
#> V27 121.4037
#> V28 -140.8023
#> V29 -1.5647
#> V3 -687.5924
#> V30 225.9061
#> V31 -346.7713
#> V32 212.1559
#> V33 12.4838
#> V34 -149.7132
#> V35 168.2877
#> V36 -20.5567
#> V37 -156.1091
#> V38 37.6458
#> V39 46.326
#> V4 816.9671
#> V40 -27.6601
#> V41 -54.8546
#> V42 55.8464
#> V43 -169.0059
#> V44 198.4007
#> V45 60.8199
#> V46 -148.0957
#> V47 318.0967
#> V48 -195.3306
#> V49 486.8697
#> V5 -176.9804
#> V50 -282.9765
#> V51 1300.5006
#> V52 457.7236
#> V53 1850.4186
#> V54 -1498.7754
#> V55 -843.84
#> V56 1043.9965
#> V57 -1876.6032
#> V58 2911.9757
#> V59 -168.8857
#> V6 -35.9018
#> V60 -2209.457
#> V7 -224.4345
#> V8 -26.9353
#> V9 77.2001
#> Intercept -74.1138
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 1.1464303484024676E70
#> V10 0
#> V11 1.0001218536876688E16
#> V12 2.484385571604982E70
#> V13 1.8359666679442502E30
#> V14 0
#> V15 7.8927377578734E23
#> V16 1.2415251882400541E13
#> V17 0
#> V18 1.429965219720224E13
#> V19 0
#> V2 0
#> V20 8.179945416742833E36
#> V21 0
#> V22 0
#> V23 1.1121160711443756E11
#> V24 3.784022656659464E46
#> V25 0
#> V26 0
#> V27 5.308224640536061E52
#> V28 0
#> V29 0.2092
#> V3 0
#> V30 1.2876385004124486E98
#> V31 0
#> V32 1.374427355190605E92
#> V33 264013.2355
#> V34 0
#> V35 1.2201189577977686E73
#> V36 0
#> V37 0
#> V38 2.2353523613874672E16
#> V39 1.3156010119896559E20
#> V4 Infinity
#> V40 0
#> V41 0
#> V42 1.7938077511867866E24
#> V43 0
#> V44 1.459889502181724E86
#> V45 2.592795453583834E26
#> V46 0
#> V47 1.4048500661980718E138
#> V48 0
#> V49 2.785053663254451E211
#> V5 0
#> V50 0
#> V51 Infinity
#> V52 6.121306597232287E198
#> V53 Infinity
#> V54 0
#> V55 0
#> V56 Infinity
#> V57 0
#> V58 Infinity
#> V59 0
#> V6 0
#> V60 0
#> V7 0
#> V8 0
#> V9 3.3696641613415303E33
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.3478261