Skip to contents

Shrinkage-based Diagonal Linear Discriminant Analysis classfier. Type of Naive Bayes classifiers that improves the estimation of the pooled variances by using a shrinkage-based estimator of the pooled covariance matrix. Calls sparsediscrim::lda_shrink_cov() sparsediscrim.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.sdlda")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, sparsediscrim

Parameters

IdTypeDefaultRange
num_alphasinteger101\((-\infty, \infty)\)
prioruntypedNULL-

References

Pang H, Tong T, Zhao H (2009). “Shrinkage-Based Diagonal Discriminant Analysis and Its Applications in High-Dimensional Data.” Biometrics, 65(4), 1021–1029. ISSN 0006341X, 15410420, http://www.jstor.org/stable/20640622.

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSdlda

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

LearnerClassifSdlda$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.sdlda")
print(learner)
#> 
#> ── <LearnerClassifSdlda> (classif.sdlda): Shrinkage-based Diagonal Linear Discri
#> • 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)
#> Shrinkage-based Diagonal LDA
#> 
#> Sample Size: 139 
#> Number of Features: 60 
#> 
#> Classes and Prior Probabilities:
#>   M (56.83%), R (43.17%) 


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

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