Skip to contents

Regularized Discriminant Analysis. Calls klaR::rda() from: klaR.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.rda")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

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

  • Required Packages: mlr3, klaR

Parameters

IdTypeDefaultLevelsRange
lambdanumeric-\([0, 1]\)
gammanumeric-\([0, 1]\)
crossvallogicalTRUETRUE, FALSE-
foldinteger10\([1, \infty)\)
train.fractionnumeric0.5\([0, 1]\)
outputlogicalFALSETRUE, FALSE-
scheduleinteger2\((-\infty, \infty)\)
T.startnumeric0.1\([0, \infty)\)
halflifenumeric50\([0, \infty)\)
zero.tempnumeric0.01\([0, \infty)\)
alphanumeric2\([1, \infty)\)
Kinteger100\([1, \infty)\)
trafologicalTRUETRUE, FALSE-
simAnnlogicalFALSETRUE, FALSE-
estimate.errorlogicalTRUETRUE, FALSE-
max.iterinteger100\((-\infty, \infty)\)

References

Friedman JH (1989). “Regularized Discriminant Analysis.” Journal of the American Statistical Association, 84(405), 165–175. ISSN 01621459, 1537274X, http://www.jstor.org/stable/2289860.

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRda

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifRda$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.rda")
print(learner)
#> 
#> ── <LearnerClassifRda> (classif.rda): Regularized Discriminant Analysis ────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3 and klaR
#> • Predict Types: [response] and prob
#> • Feature Types: logical, integer, numeric, factor, and ordered
#> • Encapsulation: none (fallback: -)
#> • Properties: 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)
#> Call: 
#> rda(formula = formula, data = data)
#> 
#> Regularization parameters: 
#>      gamma     lambda 
#> 0.07436088 0.18064672 
#> 
#> Prior probabilities of groups: 
#>         M         R 
#> 0.5395683 0.4604317 
#> 
#> Misclassification rate: 
#>        apparent: 2.158 %
#> cross-validated: 16.196 %


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

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