LFDA.Rd
This function implements local Fisher discriminant analysis. It gives the discriminant function with the posterior possibility of each class.
LFDA(x, y, r, prior = proportions, CV = FALSE, usekernel = TRUE, fL = 0, tol, kernel = "gaussian", metric = c("orthonormalized", "plain", "weighted"), knn = 5, ...)
x | Input training data |
---|---|
y | Training labels |
r | Number of reduced features that will be kept |
prior | Prior possibility of each class |
CV | Whether to do cross validation |
usekernel | Whether to use the kernel discrimination in native bayes classifier |
fL | Feed to native bayes classifier. Factor for Laplace correction, default factor is 0, i.e. no correction. |
tol | The tolerance used in Mabayes discrimination, see Mabayes |
kernel | If usekernel is TRUE, specifying the kernel names, see NaiveBaye. |
metric | The type of metric in the embedding space (no default), e.g., 'weighted', weighted eigenvectors; 'orthonormalized' , orthonormalized; 'plain', raw eigenvectors. |
knn | Number of nearest neighbors |
The results give the classified classes and the posterior possibility of each class using different classifier.
The class labels
The posterior possibility of each class
Discrimintion results using the Mabayes classifier
Discrimintion results using the Naive bayes classifier
The reduced features
Sugiyama, M (2007). Dimensionality reduction of multimodal labeled data by local Fisher discriminant analysis. Journal of Machine Learning Research, vol.8, 1027-1061.
Sugiyama, M (2006). Local Fisher discriminant analysis for supervised dimensionality reduction. In W. W. Cohen and A. Moore (Eds.), Proceedings of 23rd International Conference on Machine Learning (ICML2006), 905-912.
Tang, Y., & Li, W. (2019). lfda: Local Fisher Discriminant Analysis inR. Journal of Open Source Software, 4(39), 1572.
Moore, A. W. (2004). Naive Bayes Classifiers. In School of Computer Science. Carnegie Mellon University.
Pierre Enel (2020). Kernel Fisher Discriminant Analysis (https://www.github.com/p-enel/MatlabKFDA), GitHub. Retrieved March 30, 2020.
qinxinghu@gmail.com
LFDAtest=LFDA(iris[,1:4],y=iris[,5],r=3, CV=FALSE,usekernel = TRUE, fL = 0,kernel="gaussian",metric = "plain",knn = 6,tol = 1) LFDApred=predict.LFDA(LFDAtest,newdata=iris[1:10,1:4],prior=NULL)