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 323.3596
#> V10 193.5686
#> V11 -153.4277
#> V12 216.5916
#> V13 -15.5742
#> V14 -15.9039
#> V15 130.8642
#> V16 -210.8154
#> V17 25.6612
#> V18 42.5593
#> V19 59.5054
#> V2 830.567
#> V20 -23.5357
#> V21 -79.7565
#> V22 55.0909
#> V23 -37.6231
#> V24 164.8515
#> V25 -47.2146
#> V26 22.6388
#> V27 1.7344
#> V28 -147.0918
#> V29 99.5803
#> V3 -1095.3659
#> V30 132.7938
#> V31 -304.7755
#> V32 137.3715
#> V33 -64.8736
#> V34 -53.2151
#> V35 152.7622
#> V36 -204.5545
#> V37 -17.5409
#> V38 53.8954
#> V39 47.248
#> V4 590.4092
#> V40 -117.6406
#> V41 61.5458
#> V42 -145.4308
#> V43 82.8929
#> V44 -45.0279
#> V45 195.9841
#> V46 118.7283
#> V47 -129.0452
#> V48 257.3607
#> V49 660.3115
#> V5 -263.0591
#> V50 -1987.2503
#> V51 -1366.2747
#> V52 282.5393
#> V53 2280.501
#> V54 289.8303
#> V55 -922.6892
#> V56 -2584.1821
#> V57 476.4022
#> V58 1568.6929
#> V59 -1001.8544
#> V6 167.0703
#> V60 2689.5268
#> V7 -482.7655
#> V8 -113.6157
#> V9 151.8838
#> Intercept -4.7332
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 2.711901662063732E140
#> V10 1.1635541124171819E84
#> V11 0
#> V12 1.1602321067530342E94
#> V13 0
#> V14 0
#> V15 6.817149999584377E56
#> V16 0
#> V17 1.3948111535361716E11
#> V18 3.0427265990002586E18
#> V19 6.964066807798247E25
#> V2 Infinity
#> V20 0
#> V21 0
#> V22 8.427291361198656E23
#> V23 0
#> V24 3.9272817016202446E71
#> V25 0
#> V26 6790774040.6087
#> V27 5.6653
#> V28 0
#> V29 1.7667691844949539E43
#> V3 0
#> V30 4.694576990772526E57
#> V31 0
#> V32 4.567725809252614E59
#> V33 0
#> V34 0
#> V35 2.206965869867689E66
#> V36 0
#> V37 0
#> V38 2.5497126985352668E23
#> V39 3.307834628504685E20
#> V4 2.5790562369885942E256
#> V40 0
#> V41 5.3578674548022626E26
#> V42 0
#> V43 9.998612776125951E35
#> V44 0
#> V45 1.3026385344952382E85
#> V46 3.6561802502507295E51
#> V47 0
#> V48 5.892690626669916E111
#> V49 5.88334037975863E286
#> V5 0
#> V50 0
#> V51 0
#> V52 5.073037102098811E122
#> V53 Infinity
#> V54 7.442054729624848E125
#> V55 0
#> V56 0
#> V57 7.92259120391279E206
#> V58 Infinity
#> V59 0
#> V6 3.6115692952790794E72
#> V60 Infinity
#> V7 0
#> V8 0
#> V9 9.16811045190399E65
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.2753623