Classification Discriminant Analysis Learner
Source:R/learner_klaR_classif_rda.R
mlr_learners_classif.rda.Rd
Regularized Discriminant Analysis.
Calls klaR::rda()
from: klaR.
Parameters
Id | Type | Default | Levels | Range |
lambda | numeric | - | \([0, 1]\) | |
gamma | numeric | - | \([0, 1]\) | |
crossval | logical | TRUE | TRUE, FALSE | - |
fold | integer | 10 | \([1, \infty)\) | |
train.fraction | numeric | 0.5 | \([0, 1]\) | |
output | logical | FALSE | TRUE, FALSE | - |
schedule | integer | 2 | \((-\infty, \infty)\) | |
T.start | numeric | 0.1 | \([0, \infty)\) | |
halflife | numeric | 50 | \([0, \infty)\) | |
zero.temp | numeric | 0.01 | \([0, \infty)\) | |
alpha | numeric | 2 | \([1, \infty)\) | |
K | integer | 100 | \([1, \infty)\) | |
trafo | logical | TRUE | TRUE, FALSE | - |
simAnn | logical | FALSE | TRUE, FALSE | - |
estimate.error | logical | TRUE | TRUE, FALSE | - |
max.iter | integer | 100 | \((-\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
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifRda
Methods
Inherited methods
mlr3::Learner$base_learner()
mlr3::Learner$configure()
mlr3::Learner$encapsulate()
mlr3::Learner$format()
mlr3::Learner$help()
mlr3::Learner$predict()
mlr3::Learner$predict_newdata()
mlr3::Learner$print()
mlr3::Learner$reset()
mlr3::Learner$selected_features()
mlr3::Learner$train()
mlr3::LearnerClassif$predict_newdata_fast()
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