Classification Logistic Regression Learner
Source:R/learner_RWeka_classif_logistic.R
mlr_learners_classif.logistic.Rd
Multinomial 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/basics.html#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'
# 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 413.3824
#> V10 53.5054
#> V11 38.9102
#> V12 115.0771
#> V13 -29.7957
#> V14 -244.4594
#> V15 132.182
#> V16 -124.9696
#> V17 -83.8136
#> V18 260.9837
#> V19 -96.2017
#> V2 897.7663
#> V20 58.7225
#> V21 118.5322
#> V22 -73.234
#> V23 -106.6712
#> V24 324.9394
#> V25 -281.4295
#> V26 -26.9653
#> V27 195.2627
#> V28 -102.8256
#> V29 122.1192
#> V3 -1167.8491
#> V30 -46.0586
#> V31 -100.1899
#> V32 106.3177
#> V33 -12.9105
#> V34 -104.1168
#> V35 122.5899
#> V36 -187.1044
#> V37 2.0996
#> V38 57.5321
#> V39 -107.2947
#> V4 626.9698
#> V40 69.8101
#> V41 9.5488
#> V42 -43.4913
#> V43 222.4619
#> V44 -112.2123
#> V45 32.5748
#> V46 338.3901
#> V47 -226.8292
#> V48 -222.405
#> V49 640.8788
#> V5 -246.6863
#> V50 -1757.5961
#> V51 2049.2274
#> V52 -1389.5304
#> V53 1378.2955
#> V54 -1090.0191
#> V55 -299.6076
#> V56 2187.6941
#> V57 1273.2075
#> V58 1436.1245
#> V59 -480.8514
#> V6 -71.8112
#> V60 -1806.7575
#> V7 -18.6068
#> V8 -302.6677
#> V9 234.4089
#> Intercept -101.9866
#>
#>
#> Odds Ratios...
#> Class
#> Variable M
#> ===================================
#> V1 3.3862094708417505E179
#> V10 1.7262479020416248E23
#> V11 7.9157842152953504E16
#> V12 9.49216285582521E49
#> V13 0
#> V14 0
#> V15 2.5462461529155083E57
#> V16 0
#> V17 0
#> V18 2.2069185770565064E113
#> V19 0
#> V2 Infinity
#> V20 3.183296372718477E25
#> V21 3.005113329777534E51
#> V22 0
#> V23 0
#> V24 1.3163793065820009E141
#> V25 0
#> V26 0
#> V27 6.331480935994621E84
#> V28 0
#> V29 1.0856945281782858E53
#> V3 0
#> V30 0
#> V31 0
#> V32 1.4900418304281401E46
#> V33 0
#> V34 0
#> V35 1.7382893066148746E53
#> V36 0
#> V37 8.1629
#> V38 9.679628941447267E24
#> V39 0
#> V4 1.9477932184301318E272
#> V40 2.080358016063862E30
#> V41 14028.1409
#> V42 0
#> V43 4.111149706714756E96
#> V44 0
#> V45 1.4030084687092003E14
#> V46 9.13995430240522E146
#> V47 0
#> V48 0
#> V49 2.1386619937367756E278
#> V5 0
#> V50 0
#> V51 Infinity
#> V52 0
#> V53 Infinity
#> V54 0
#> V55 0
#> V56 Infinity
#> V57 Infinity
#> V58 Infinity
#> V59 0
#> V6 0
#> V60 0
#> V7 0
#> V8 0
#> V9 6.346130192186756E101
#>
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.4057971