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                         370.5697
#> V10                        143.1818
#> V11                       -152.9261
#> V12                        287.3225
#> V13                         -5.1001
#> V14                        -75.1284
#> V15                         80.0859
#> V16                         -61.013
#> V17                        -31.2912
#> V18                        -53.7102
#> V19                         83.0045
#> V2                         -71.9162
#> V20                         93.8894
#> V21                       -100.2491
#> V22                        -47.5564
#> V23                         95.1466
#> V24                         69.9909
#> V25                         -1.4953
#> V26                        -23.3915
#> V27                        -41.2856
#> V28                         95.4942
#> V29                        -130.891
#> V3                          -2.1064
#> V30                        234.9719
#> V31                       -205.1672
#> V32                        -15.5574
#> V33                        -54.9617
#> V34                          46.735
#> V35                         62.7817
#> V36                       -111.6255
#> V37                        -38.0053
#> V38                         46.1936
#> V39                         21.3334
#> V4                         231.5476
#> V40                        -63.7183
#> V41                         70.4425
#> V42                        -69.7141
#> V43                         -55.865
#> V44                        115.1771
#> V45                         86.1194
#> V46                       -173.7034
#> V47                         110.341
#> V48                        277.9634
#> V49                        739.8674
#> V5                          31.2131
#> V50                      -1548.2821
#> V51                         320.343
#> V52                        243.0968
#> V53                         207.081
#> V54                        829.5929
#> V55                       -833.2557
#> V56                      -2310.8612
#> V57                       -515.6823
#> V58                       2286.7722
#> V59                      -2129.7279
#> V6                          98.5231
#> V60                       2553.2402
#> V7                        -598.4421
#> V8                         167.0479
#> V9                         -53.6594
#> Intercept                  -61.9679
#> 
#> 
#> Odds Ratios...
#>                               Class
#> Variable                          M
#> ===================================
#> V1            8.637417298534248E160
#> V10           1.5242818535693146E62
#> V11                               0
#> V12           6.061623592089426E124
#> V13                          0.0061
#> V14                               0
#> V15            6.037878992457494E34
#> V16                               0
#> V17                               0
#> V18                               0
#> V19           1.1178558736288364E36
#> V2                                0
#> V20            5.965373666504005E40
#> V21                               0
#> V22                               0
#> V23           2.0972863672666717E41
#> V24           2.4927574151657843E30
#> V25                          0.2242
#> V26                               0
#> V27                               0
#> V28           2.9690480485443185E41
#> V29                               0
#> V3                           0.1217
#> V30          1.1142849098390207E102
#> V31                               0
#> V32                               0
#> V33                               0
#> V34            1.980387932926697E20
#> V35            1.843876870222772E27
#> V36                               0
#> V37                               0
#> V38           1.1524464433460206E20
#> V39                 1840684659.6572
#> V4            3.629512657256186E100
#> V40                               0
#> V41           3.9153952804281957E30
#> V42                               0
#> V43                               0
#> V44           1.0490266357672045E50
#> V45            2.518618486550503E37
#> V46                               0
#> V47            8.326785252073056E47
#> V48            5.22368813794653E120
#> V49                        Infinity
#> V5            3.5946501441173805E13
#> V50                               0
#> V51          1.3280414012202704E139
#> V52          3.7635231514814175E105
#> V53            8.593246604792927E89
#> V54                        Infinity
#> V55                               0
#> V56                               0
#> V57                               0
#> V58                        Infinity
#> V59                               0
#> V6             6.138277181977098E42
#> V60                        Infinity
#> V7                                0
#> V8              3.53155644961824E72
#> V9                                0
#> 


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

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