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


Method new()

Creates a new instance of this R6 class.


Method marshal()

Marshal the learner's model.

Usage

LearnerClassifLogistic$marshal(...)

Arguments

...

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


Method unmarshal()

Unmarshal the learner's model.

Usage

LearnerClassifLogistic$unmarshal(...)

Arguments

...

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


Method 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'

# 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