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()
Method marshal()
Marshal the learner's model.
Arguments
...(any)
Additional arguments passed tomlr3::marshal_model().
Method 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 -263.4072
#> V10 -13.8088
#> V11 133.8381
#> V12 186.6024
#> V13 -138.403
#> V14 -5.493
#> V15 92.8874
#> V16 -94.5322
#> V17 -63.4275
#> V18 61.6422
#> V19 39.3462
#> V2 462.4103
#> V20 -37.6487
#> V21 59.4964
#> V22 3.7933
#> V23 -56.7896
#> V24 134.0078
#> V25 -40.3506
#> V26 -173.3188
#> V27 167.1733
#> V28 -32.78
#> V29 -84.1099
#> V3 -1008.024
#> V30 194.6436
#> V31 -138.0099
#> V32 -9.7292
#> V33 127.1937
#> V34 -128.9156
#> V35 111.7011
#> V36 -148.2033
#> V37 -27.4678
#> V38 115.4057
#> V39 134.5644
#> V4 492.745
#> V40 -243.2527
#> V41 128.8529
#> V42 -183.2985
#> V43 187.047
#> V44 -41.9084
#> V45 -26.3082
#> V46 65.6267
#> V47 443.602
#> V48 -222.2148
#> V49 435.4432
#> V5 87.5696
#> V50 -1824.7093
#> V51 -427.2106
#> V52 402.6841
#> V53 619.3993
#> V54 227.9052
#> V55 -1254.6864
#> V56 791.0471
#> V57 1474.0807
#> V58 1341.0032
#> V59 168.6937
#> V6 334.5775
#> V60 -1843.2785
#> V7 -104.061
#> V8 -127.7339
#> V9 92.6896
#> Intercept -112.8103
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 0
#> V10 0
#> V11 1.3340150424490056E58
#> V12 1.0974403062993018E81
#> V13 0
#> V14 0.0041
#> V15 2.1902147592712604E40
#> V16 0
#> V17 0
#> V18 5.900039230478118E26
#> V19 1.22410814133406704E17
#> V2 6.641317278583542E200
#> V20 0
#> V21 6.901842264794051E25
#> V22 44.4021
#> V23 0
#> V24 1.580620315819794E58
#> V25 0
#> V26 0
#> V27 4.003638086622649E72
#> V28 0
#> V29 0
#> V3 0
#> V30 3.4089517411374233E84
#> V31 0
#> V32 0.0001
#> V33 1.7358112075561536E55
#> V34 0
#> V35 3.24475269653034E48
#> V36 0
#> V37 0
#> V38 1.318434122270976E50
#> V39 2.757774150776028E58
#> V4 9.918445331597629E213
#> V40 0
#> V41 9.122557780730907E55
#> V42 0
#> V43 1.7119141410845874E81
#> V44 0
#> V45 0
#> V46 3.1718199605493424E28
#> V47 4.5072290131915543E192
#> V48 0
#> V49 1.2899187744686102E189
#> V5 1.0739593279589422E38
#> V50 0
#> V51 0
#> V52 7.647221368982514E174
#> V53 1.0039569498938796E269
#> V54 9.505264660449733E98
#> V55 0
#> V56 Infinity
#> V57 Infinity
#> V58 Infinity
#> V59 1.831199244421792E73
#> V6 2.0190387772148622E145
#> V60 0
#> V7 0
#> V8 0
#> V9 1.7971450299372218E40
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.2753623