qda

fun qda(x: Array<DoubleArray>, y: IntArray, priori: DoubleArray? = null, tol: Double = 1.0E-4): QDA

Quadratic discriminant analysis. QDA is closely related to linear discriminant analysis (LDA). Like LDA, QDA models the conditional probability density functions as a Gaussian distribution, then uses the posterior distributions to estimate the class for a given test data. Unlike LDA, however, in QDA there is no assumption that the covariance of each of the classes is identical. Therefore, the resulting separating surface between the classes is quadratic.

The Gaussian parameters for each class can be estimated from training data with maximum likelihood (ML) estimation. However, when the number of training instances is small compared to the dimension of input space, the ML covariance estimation can be ill-posed. One approach to resolve the ill-posed estimation is to regularize the covariance estimation. One of these regularization methods is {@link rda regularized discriminant analysis}.

Return

Quadratic discriminant analysis model.

Parameters

x

training samples.

y

training labels in [0, k), where k is the number of classes.

priori

the priori probability of each class. If null, it will be estimated from the training data.

tol

a tolerance to decide if a covariance matrix is singular; it will reject variables whose variance is less than tol2.