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 370.5697
#> V10 143.1818
#> V11 -152.9261
#> V12 287.3225
#> V13 -5.1001
#> V14 -75.1284
#> V15 80.0859
#> V16 -61.013
#> V17 -31.2912
#> V18 -53.7102
#> V19 83.0045
#> V2 -71.9162
#> V20 93.8894
#> V21 -100.2491
#> V22 -47.5564
#> V23 95.1466
#> V24 69.9909
#> V25 -1.4953
#> V26 -23.3915
#> V27 -41.2856
#> V28 95.4942
#> V29 -130.891
#> V3 -2.1064
#> V30 234.9719
#> V31 -205.1672
#> V32 -15.5574
#> V33 -54.9617
#> V34 46.735
#> V35 62.7817
#> V36 -111.6255
#> V37 -38.0053
#> V38 46.1936
#> V39 21.3334
#> V4 231.5476
#> V40 -63.7183
#> V41 70.4425
#> V42 -69.7141
#> V43 -55.865
#> V44 115.1771
#> V45 86.1194
#> V46 -173.7034
#> V47 110.341
#> V48 277.9634
#> V49 739.8674
#> V5 31.2131
#> V50 -1548.2821
#> V51 320.343
#> V52 243.0968
#> V53 207.081
#> V54 829.5929
#> V55 -833.2557
#> V56 -2310.8612
#> V57 -515.6823
#> V58 2286.7722
#> V59 -2129.7279
#> V6 98.5231
#> V60 2553.2402
#> V7 -598.4421
#> V8 167.0479
#> V9 -53.6594
#> Intercept -61.9679
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 8.637417298534248E160
#> V10 1.5242818535693146E62
#> V11 0
#> V12 6.061623592089426E124
#> V13 0.0061
#> V14 0
#> V15 6.037878992457494E34
#> V16 0
#> V17 0
#> V18 0
#> V19 1.1178558736288364E36
#> V2 0
#> V20 5.965373666504005E40
#> V21 0
#> V22 0
#> V23 2.0972863672666717E41
#> V24 2.4927574151657843E30
#> V25 0.2242
#> V26 0
#> V27 0
#> V28 2.9690480485443185E41
#> V29 0
#> V3 0.1217
#> V30 1.1142849098390207E102
#> V31 0
#> V32 0
#> V33 0
#> V34 1.980387932926697E20
#> V35 1.843876870222772E27
#> V36 0
#> V37 0
#> V38 1.1524464433460206E20
#> V39 1840684659.6572
#> V4 3.629512657256186E100
#> V40 0
#> V41 3.9153952804281957E30
#> V42 0
#> V43 0
#> V44 1.0490266357672045E50
#> V45 2.518618486550503E37
#> V46 0
#> V47 8.326785252073056E47
#> V48 5.22368813794653E120
#> V49 Infinity
#> V5 3.5946501441173805E13
#> V50 0
#> V51 1.3280414012202704E139
#> V52 3.7635231514814175E105
#> V53 8.593246604792927E89
#> V54 Infinity
#> V55 0
#> V56 0
#> V57 0
#> V58 Infinity
#> V59 0
#> V6 6.138277181977098E42
#> V60 Infinity
#> V7 0
#> V8 3.53155644961824E72
#> V9 0
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.3478261