Skip to contents

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

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.logistic")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”

  • Required Packages: mlr3, RWeka

Parameters

IdTypeDefaultLevelsRange
subsetuntyped--
na.actionuntyped--
ClogicalFALSETRUE, FALSE-
Rnumeric-\((-\infty, \infty)\)
Minteger-1\((-\infty, \infty)\)
output_debug_infologicalFALSETRUE, FALSE-
do_not_check_capabilitieslogicalFALSETRUE, FALSE-
num_decimal_placesinteger2\([1, \infty)\)
batch_sizeinteger100\([1, \infty)\)
optionsuntypedNULL-

References

le Cessie, S., van Houwelingen, J.C. (1992). “Ridge Estimators in Logistic Regression.” Applied Statistics, 41(1), 191-201.

See also

Author

damirpolat

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLogistic

Active bindings

marshaled

(logical(1))
Whether the learner has been marshaled.

Methods

Inherited methods


LearnerClassifLogistic$new()

Creates a new instance of this R6 class.


LearnerClassifLogistic$marshal()

Marshal the learner's model.

Usage

LearnerClassifLogistic$marshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


LearnerClassifLogistic$unmarshal()

Unmarshal the learner's model.

Usage

LearnerClassifLogistic$unmarshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::unmarshal_model().


LearnerClassifLogistic$clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifLogistic$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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