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
Meta Information
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
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, mlr3extralearners, 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 1327.368
#> V10 146.5317
#> V11 -174.0847
#> V12 302.1699
#> V13 -218.3503
#> V14 88.7405
#> V15 -0.7847
#> V16 -106.3739
#> V17 9.031
#> V18 -136.918
#> V19 141.8346
#> V2 787.7623
#> V20 110.0731
#> V21 -216.5109
#> V22 181.1463
#> V23 -14.3622
#> V24 29.6899
#> V25 8.6821
#> V26 124.713
#> V27 -118.7042
#> V28 28.3471
#> V29 36.2853
#> V3 -831.7225
#> V30 78.0707
#> V31 -159.2178
#> V32 -16.1031
#> V33 160.0458
#> V34 -210.0589
#> V35 19.3569
#> V36 -82.924
#> V37 12.9531
#> V38 85.7761
#> V39 -74.2901
#> V4 607.8029
#> V40 -41.1929
#> V41 91.1016
#> V42 90.7855
#> V43 8.9869
#> V44 -24.1388
#> V45 24.5989
#> V46 39.8598
#> V47 29.2547
#> V48 -23.6835
#> V49 449.1006
#> V5 -23.9183
#> V50 -1442.8559
#> V51 3338.7339
#> V52 38.9798
#> V53 266.2998
#> V54 -675.6891
#> V55 -51.991
#> V56 3267.7775
#> V57 -1773.3532
#> V58 1014.9576
#> V59 1387.8456
#> V6 109.5641
#> V60 -3078.131
#> V7 -162.0095
#> V8 -541.5009
#> V9 327.2425
#> Intercept -172.941
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 Infinity
#> V10 4.344006769092759E63
#> V11 0
#> V12 1.7010353866430127E131
#> V13 0
#> V14 3.463362788928768E38
#> V15 0.4562
#> V16 0
#> V17 8357.8533
#> V18 0
#> V19 3.962774118713483E61
#> V2 Infinity
#> V20 6.369891828777194E47
#> V21 0
#> V22 4.686363227730064E78
#> V23 0
#> V24 7.837179958202161E12
#> V25 5896.1254
#> V26 1.4526843073409372E54
#> V27 0
#> V28 2.0463880334585967E12
#> V29 5.734608568555193E15
#> V3 0
#> V30 8.048093625084254E33
#> V31 0
#> V32 0
#> V33 3.2136312675589158E69
#> V34 0
#> V35 255026513.3984
#> V36 0
#> V37 422141.5637
#> V38 1.7869166834434036E37
#> V39 0
#> V4 9.23557921664061E263
#> V40 0
#> V41 3.672235610880464E39
#> V42 2.676900391633147E39
#> V43 7997.876
#> V44 0
#> V45 4.8210882920715866E10
#> V46 2.0460064215110086E17
#> V47 5.071626444831377E12
#> V48 0
#> V49 1.1013657750945146E195
#> V5 0
#> V50 0
#> V51 Infinity
#> V52 8.486594473842544E16
#> V53 4.492839338303564E115
#> V54 0
#> V55 0
#> V56 Infinity
#> V57 0
#> V58 Infinity
#> V59 Infinity
#> V6 3.828939106852473E47
#> V60 0
#> V7 0
#> V8 0
#> V9 1.3171326019385437E142
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.3478261