predict.ldaGSVD {LDATree}R Documentation

Predictions from a fitted ldaGSVD object

Description

Prediction of test data using a fitted ldaGSVD object

Usage

## S3 method for class 'ldaGSVD'
predict(object, newdata, type = c("response", "prob"), ...)

Arguments

object

a fitted model object of class ldaGSVD, which is assumed to be the result of the ldaGSVD() function.

newdata

data frame containing the values at which predictions are required. Missing values are NOT allowed.

type

character string denoting the type of predicted value returned. The default is to return the predicted class (type = 'response'). The predicted posterior probabilities for each class will be returned if type = 'prob'.

...

further arguments passed to or from other methods.

Details

Unlike the original paper, which uses the k-nearest neighbor (k-NN) as the classifier, we use a faster and more straightforward likelihood-based method. One limitation of the traditional likelihood-based method for LDA is that it ceases to work when there are Linear Discriminant (LD) directions with zero variance in the within-class scatter matrix. However, when using LDA/GSVD, all chosen LD directions possess non-zero variance in the between-class scatter matrix. This implies that LD directions with zero variance in the within-class scatter matrix will yield the highest Fisher's ratio. Therefore, to get these directions higher weights, we manually adjust the zero variance to 1e-15 for computational reasons.

Value

The function returns different values based on the type, if

References

Ye, J., Janardan, R., Park, C. H., & Park, H. (2004). An optimization criterion for generalized discriminant analysis on undersampled problems. IEEE Transactions on Pattern Analysis and Machine Intelligence

Howland, P., Jeon, M., & Park, H. (2003). Structure preserving dimension reduction for clustered text data based on the generalized singular value decomposition. SIAM Journal on Matrix Analysis and Applications

Examples

fit <- ldaGSVD(Species~., data = iris)
predict(fit,iris)
# output prosterior probabilities
predict(fit,iris,type = "prob")

[Package LDATree version 0.1.2 Index]