Learn R Programming

OptimClassifier (version 0.1.5)

Optim.DA: Discover the best Discriminant Analysis for your data

Description

This function search the best Discriminant Analysis (DA) between LDA and QDA.

Usage

Optim.DA(formula, data, p, criteria = c("rmse", "success_rate",
  "ti_error", "tii_error"), includedata = FALSE, seed = NULL, ...)

Arguments

formula

A formula of the form y ~ x1 + x2 + …

data

Data frame from which variables specified in formula are preferentially to be taken.

p

A percentage of training elements

criteria

Select criterion to use.

includedata

logicals. If TRUE the training and testing datasets are returned.

seed

a single value, interpreted as an integer, or NULL. The default value is NULL, but for future checks of the model or models generated it is advisable to set a random seed to be able to reproduce it.

...

arguments passed to lda and qda

Value

An object of class Optim. See Optim.object

Details

LDA and QDA are distribution-based classifiers with the assumption that data follows a multivariate normal distribution. LDA differs from QDA in the assumption about the class variability. LDA assumes that all classes share the same within-class covariance matrix whereas QDA allows for distinct within-class covariance matrices.

Examples

Run this code
# NOT RUN {
if(interactive()){
## Load a Dataset
data(AustralianCredit)
## Generate a Model
modelFit <- Optim.DA(Y~., AustralianCredit, p = 0.7, seed=2018)
modelFit
}

# }

Run the code above in your browser using DataLab