rda

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

Regularized discriminant analysis. RDA is a compromise between LDA and QDA, which allows one to shrink the separate covariances of QDA toward a common variance as in LDA. This method is very similar in flavor to ridge regression. The regularized covariance matrices of each class is Σk(α) = α Σk + (1 - α) Σ. The quadratic discriminant function is defined using the shrunken covariance matrices Σk(α). The parameter α in [0, 1] controls the complexity of the model. When α is one, RDA becomes QDA. While α is zero, RDA is equivalent to LDA. Therefore, the regularization factor α allows a continuum of models between LDA and QDA.

Return

Regularized discriminant analysis model.

Parameters

x

training samples.

y

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

alpha

regularization factor in [0, 1] allows a continuum of models between LDA and QDA.

priori

the priori probability of each class.

tol

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