Kernel Local Fisher Discriminant Analysis (KLFDA). This function implements the Kernel Local Fisher Discriminant Analysis with a Multinomial kernel.

KLFDA(X, Y, r, order, regParam, usekernel = TRUE, fL = 0.5, priors, tol, reg, metric, plotFigures = FALSE, verbose, ...)

Arguments

X

The input training data

Y

The training labels

r

The number of reduced features

order

The order passing to Multinomial Kernel

regParam

The regularization parameter for kernel matrix

usekernel

Whether to used kernel classifier

fL

pass to kernel classifier if usekenel is TRUE

priors

The weight of each class

tol

The tolerance for rejecting uni-variance

reg

The regularization parameter

metric

Type of metric in the embedding space (default: 'weighted') 'weighted' - weighted eigenvectors 'orthonormalized' - orthonormalized 'plain' - raw eigenvectors

plotFigures

whether to plot the reduced features, 3D plot

Details

This function uses Multinomial Kernel, users can replace the Multinomial Kernel based on your own purpose. The final discrimination employs three classifiers, the basic linear classifier, the Mabayes (Bayes rule and the Mahalanobis distance), and Niave Bayes classifier.

Value

class

The class labels from linear classifier

posterior

The posterior possibility of each class from linear classifier

bayes_judgement

Discrimintion results using the Mabayes classifier

bayes_assigment

Discrimintion results using the Naive bayes classifier

Z

The reduced features

%% ...

References

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.

Original Matlab Implementation: http://www.ms.k.u-tokyo.ac.jp/software.html#LFDA

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.

Karatzoglou, A., Smola, A., Hornik, K., & Zeileis, A. (2004). kernlab-an S4 package for kernel methods in R. Journal of statistical software, 11(9), 1-20.

Author

qinxinghu@gmail.com

See also

predict.KLFDA, klfda_1

Examples

btest=KLFDA(X=as.matrix(iris[,1:4]),Y=as.matrix(as.data.frame(iris[,5])),r=3,order=2,regParam=0.25, usekernel=TRUE,fL=0.5,priors=NULL,tol=1e-90,reg=0.01,metric = 'plain',plotFigures=FALSE, verbose=TRUE)
#> Loading required package: lfda
#> Loading required package: MASS
#> [1] "Computing K..." #> [1] "Mean K is 25.153348085363"
#> Loading required package: klaR
pred=predict.KLFDA(btest,as.matrix(iris[1:10,1:4]))
#> Warning: Numerical 0 probability for all classes with observation 1
#> Warning: Numerical 0 probability for all classes with observation 2
#> Warning: Numerical 0 probability for all classes with observation 3
#> Warning: Numerical 0 probability for all classes with observation 4
#> Warning: Numerical 0 probability for all classes with observation 5
#> Warning: Numerical 0 probability for all classes with observation 6
#> Warning: Numerical 0 probability for all classes with observation 7
#> Warning: Numerical 0 probability for all classes with observation 8
#> Warning: Numerical 0 probability for all classes with observation 9
#> Warning: Numerical 0 probability for all classes with observation 10
#> Warning: Numerical 0 probability for all classes with observation 1
#> Warning: Numerical 0 probability for all classes with observation 2
#> Warning: Numerical 0 probability for all classes with observation 3
#> Warning: Numerical 0 probability for all classes with observation 4
#> Warning: Numerical 0 probability for all classes with observation 5
#> Warning: Numerical 0 probability for all classes with observation 6
#> Warning: Numerical 0 probability for all classes with observation 7
#> Warning: Numerical 0 probability for all classes with observation 8
#> Warning: Numerical 0 probability for all classes with observation 9
#> Warning: Numerical 0 probability for all classes with observation 10