Skip to contents

Diagonal Linear Discriminant Analysis classifier. Belongs to the family of Naive Bayes classifiers, where the distributions of each class are assumed to be multivariate normal and to share a common covariance matrix. Off-diagonal elements of the pooled sample covariance matrix are set to zero Calls sparsediscrim::lda_diag() from sparsediscrim.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.dlda")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, sparsediscrim

Parameters

IdTypeDefault
prioruntypedNULL

References

Dudoit S, Fridlyand J, Speed TP (2002). “Comparison of Discrimination Methods for the Classification of Tumors Using Gene Expression Data.” Journal of the American Statistical Association, 97(457), 77–87. doi:10.1198/016214502753479248 .

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDiagLda

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

LearnerClassifDiagLda$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.dlda")
print(learner)
#> 
#> ── <LearnerClassifDiagLda> (classif.dlda): Diagonal Linear Discriminant Analysis
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3 and sparsediscrim
#> • Predict Types: [response] and prob
#> • Feature Types: integer and numeric
#> • 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)
#> Diagonal LDA
#> 
#> Sample Size: 139 
#> Number of Features: 60 
#> 
#> Classes and Prior Probabilities:
#>   M (57.55%), R (42.45%) 


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

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