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', 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                        -263.4072
#> V10                        -13.8088
#> V11                        133.8381
#> V12                        186.6024
#> V13                        -138.403
#> V14                          -5.493
#> V15                         92.8874
#> V16                        -94.5322
#> V17                        -63.4275
#> V18                         61.6422
#> V19                         39.3462
#> V2                         462.4103
#> V20                        -37.6487
#> V21                         59.4964
#> V22                          3.7933
#> V23                        -56.7896
#> V24                        134.0078
#> V25                        -40.3506
#> V26                       -173.3188
#> V27                        167.1733
#> V28                          -32.78
#> V29                        -84.1099
#> V3                        -1008.024
#> V30                        194.6436
#> V31                       -138.0099
#> V32                         -9.7292
#> V33                        127.1937
#> V34                       -128.9156
#> V35                        111.7011
#> V36                       -148.2033
#> V37                        -27.4678
#> V38                        115.4057
#> V39                        134.5644
#> V4                          492.745
#> V40                       -243.2527
#> V41                        128.8529
#> V42                       -183.2985
#> V43                         187.047
#> V44                        -41.9084
#> V45                        -26.3082
#> V46                         65.6267
#> V47                         443.602
#> V48                       -222.2148
#> V49                        435.4432
#> V5                          87.5696
#> V50                      -1824.7093
#> V51                       -427.2106
#> V52                        402.6841
#> V53                        619.3993
#> V54                        227.9052
#> V55                      -1254.6864
#> V56                        791.0471
#> V57                       1474.0807
#> V58                       1341.0032
#> V59                        168.6937
#> V6                         334.5775
#> V60                      -1843.2785
#> V7                         -104.061
#> V8                        -127.7339
#> V9                          92.6896
#> Intercept                 -112.8103
#> 
#> 
#> Odds Ratios...
#>                               Class
#> Variable                          M
#> ===================================
#> V1                                0
#> V10                               0
#> V11           1.3340150424490056E58
#> V12           1.0974403062993018E81
#> V13                               0
#> V14                          0.0041
#> V15           2.1902147592712604E40
#> V16                               0
#> V17                               0
#> V18            5.900039230478118E26
#> V19          1.22410814133406704E17
#> V2            6.641317278583542E200
#> V20                               0
#> V21            6.901842264794051E25
#> V22                         44.4021
#> V23                               0
#> V24            1.580620315819794E58
#> V25                               0
#> V26                               0
#> V27            4.003638086622649E72
#> V28                               0
#> V29                               0
#> V3                                0
#> V30           3.4089517411374233E84
#> V31                               0
#> V32                          0.0001
#> V33           1.7358112075561536E55
#> V34                               0
#> V35             3.24475269653034E48
#> V36                               0
#> V37                               0
#> V38            1.318434122270976E50
#> V39            2.757774150776028E58
#> V4            9.918445331597629E213
#> V40                               0
#> V41            9.122557780730907E55
#> V42                               0
#> V43           1.7119141410845874E81
#> V44                               0
#> V45                               0
#> V46           3.1718199605493424E28
#> V47          4.5072290131915543E192
#> V48                               0
#> V49          1.2899187744686102E189
#> V5            1.0739593279589422E38
#> V50                               0
#> V51                               0
#> V52           7.647221368982514E174
#> V53          1.0039569498938796E269
#> V54            9.505264660449733E98
#> V55                               0
#> V56                        Infinity
#> V57                        Infinity
#> V58                        Infinity
#> V59            1.831199244421792E73
#> V6           2.0190387772148622E145
#> V60                               0
#> V7                                0
#> V8                                0
#> V9            1.7971450299372218E40
#> 


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

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