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 -8.7748
#> V10 -183.5951
#> V11 -27.2494
#> V12 257.3848
#> V13 19.2741
#> V14 -68.9485
#> V15 123.3183
#> V16 68.1349
#> V17 -267.1979
#> V18 233.008
#> V19 -187.8455
#> V2 213.4933
#> V20 42.9281
#> V21 12.6662
#> V22 14.8055
#> V23 84.9423
#> V24 -12.7605
#> V25 7.0441
#> V26 -107.0764
#> V27 165.2189
#> V28 -94.9821
#> V29 -105.0008
#> V3 -259.7656
#> V30 393.7384
#> V31 -469.1141
#> V32 126.7064
#> V33 163.4831
#> V34 -176.0436
#> V35 199.7075
#> V36 -142.7818
#> V37 -48.3867
#> V38 -38.6876
#> V39 119.7624
#> V4 146.705
#> V40 -176.6791
#> V41 154.617
#> V42 -196.2432
#> V43 216.8223
#> V44 24.3296
#> V45 -117.3234
#> V46 -16.7365
#> V47 506.5591
#> V48 -434.8651
#> V49 873.7965
#> V5 213.5838
#> V50 -1372.2547
#> V51 1957.1567
#> V52 -574.5882
#> V53 -415.4841
#> V54 423.1343
#> V55 -1006.6403
#> V56 1797.0264
#> V57 -800.6245
#> V58 1120.651
#> V59 357.1519
#> V6 -210.2718
#> V60 -774.1033
#> V7 54.6547
#> V8 -470.6933
#> V9 408.599
#> Intercept -83.6785
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 0.0002
#> V10 0
#> V11 0
#> V12 6.036876657709226E111
#> V13 234774728.0351
#> V14 0
#> V15 3.6013114776328415E53
#> V16 3.895761802539427E29
#> V17 0
#> V18 1.5634049953879232E101
#> V19 0
#> V2 5.23553528983334E92
#> V20 4.3998001626945592E18
#> V21 316850.5065
#> V22 2691269.4152
#> V23 7.761744473240858E36
#> V24 0
#> V25 1146.1261
#> V26 0
#> V27 5.670993253748027E71
#> V28 0
#> V29 0
#> V3 0
#> V30 9.96389857282843E170
#> V31 0
#> V32 1.0663561019629185E55
#> V33 9.995364178476721E70
#> V34 0
#> V35 5.393194216654386E86
#> V36 0
#> V37 0
#> V38 0
#> V39 1.0283933230563507E52
#> V4 5.16641575616192E63
#> V40 0
#> V41 1.4102757939221526E67
#> V42 0
#> V43 1.4612979877780242E94
#> V44 3.683155008037368E10
#> V45 0
#> V46 0
#> V47 9.904574961167538E219
#> V48 0
#> V49 Infinity
#> V5 5.73153752848509E92
#> V50 0
#> V51 Infinity
#> V52 0
#> V53 0
#> V54 5.819399153316859E183
#> V55 0
#> V56 Infinity
#> V57 0
#> V58 Infinity
#> V59 1.285615595308384E155
#> V6 0
#> V60 0
#> V7 5.448168010510172E23
#> V8 0
#> V9 2.833153418067072E177
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.3188406