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                         546.9777
#> V10                        -76.5716
#> V11                         -3.2155
#> V12                        286.8514
#> V13                        -77.0414
#> V14                        101.4057
#> V15                         60.6781
#> V16                       -136.4864
#> V17                       -104.7509
#> V18                        182.4691
#> V19                       -107.6795
#> V2                        -145.0619
#> V20                        113.0661
#> V21                        -15.6865
#> V22                        -59.1842
#> V23                         86.7856
#> V24                         29.8588
#> V25                        -37.5845
#> V26                         30.6824
#> V27                          -1.858
#> V28                         43.8203
#> V29                       -122.3782
#> V3                        -705.4569
#> V30                        231.1773
#> V31                       -261.1032
#> V32                         19.0317
#> V33                        164.1098
#> V34                       -210.2673
#> V35                        299.4409
#> V36                       -244.8075
#> V37                         63.7461
#> V38                        -112.846
#> V39                        200.5317
#> V4                         127.2381
#> V40                       -161.4178
#> V41                         13.2935
#> V42                         -15.724
#> V43                        -14.2337
#> V44                         96.4133
#> V45                        -86.7176
#> V46                        142.7075
#> V47                         60.6169
#> V48                        176.3769
#> V49                        848.6494
#> V5                        -213.0398
#> V50                       -2001.824
#> V51                         1070.84
#> V52                       2123.8501
#> V53                       1014.3561
#> V54                        220.1159
#> V55                      -1012.1529
#> V56                        358.7561
#> V57                      -2785.4128
#> V58                       1351.9463
#> V59                       1260.4131
#> V6                         321.2336
#> V60                       1219.8387
#> V7                        -387.6984
#> V8                         -57.7748
#> V9                         160.1755
#> Intercept                 -150.0531
#> 
#> 
#> Odds Ratios...
#>                               Class
#> Variable                          M
#> ===================================
#> V1           3.5430468204178025E237
#> V10                               0
#> V11                          0.0401
#> V12          3.7843293129266773E124
#> V13                               0
#> V14            1.096324969651127E44
#> V15            2.249968413205226E26
#> V16                               0
#> V17                               0
#> V18           1.7591542633330597E79
#> V19                               0
#> V2                                0
#> V20            1.270583686811129E49
#> V21                               0
#> V22                               0
#> V23            4.903549553320891E37
#> V24            9.279289378430262E12
#> V25                               0
#> V26           2.1143714318277066E13
#> V27                           0.156
#> V28           1.0737438632098636E19
#> V29                               0
#> V3                                0
#> V30          2.5061533337566248E100
#> V31                               0
#> V32                  184221713.6755
#> V33           1.8705856102567994E71
#> V34                               0
#> V35          1.1105783826619472E130
#> V36                               0
#> V37           4.8369760565545275E27
#> V38                               0
#> V39           1.2297674697007022E87
#> V4               1.8146502644658E55
#> V40                               0
#> V41                     593355.9091
#> V42                               0
#> V43                               0
#> V44            7.443111256524907E41
#> V45                               0
#> V46            9.486013281505841E61
#> V47           2.1163900826576165E26
#> V48            3.976449100977918E76
#> V49                        Infinity
#> V5                                0
#> V50                               0
#> V51                        Infinity
#> V52                        Infinity
#> V53                        Infinity
#> V54           3.9365391315872605E95
#> V55                               0
#> V56           6.394207852204964E155
#> V57                               0
#> V58                        Infinity
#> V59                        Infinity
#> V6           3.2357754034463443E139
#> V60                        Infinity
#> V7                                0
#> V8                                0
#> V9             3.658658965919883E69
#> 


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> classif.ce 
#>  0.2318841