Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

lfda

R package for Local Fisher Discriminant Analysis

Subscribe to updates I use lfda


Statistics on lfda

Number of watchers on Github 65
Number of open issues 1
Average time to close an issue 3 months
Main language R
Average time to merge a PR about 1 hour
Open pull requests 0+
Closed pull requests 1+
Last commit over 2 years ago
Repo Created almost 4 years ago
Repo Last Updated over 1 year ago
Size 79 KB
Organization / Authorterrytangyuan
Latest Release1.1.2
Contributors2
Page Updated
Do you use lfda? Leave a review!
View lfda activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating lfda for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Travis-CI Build Status Coverage Status CRAN_Status_Badge License

lfda

R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semi-supervised Local Fisher Discriminant Analysis.

Introduction to the algorithms and their application can be found here and here. These methods are widely applied in feature extraction, dimensionality reduction, clustering, classification, information retrieval, and computer vision problems.

Welcome any feedback and pull request.

Install the current release from CRAN:

install.packages('lfda')

Install the latest development version from github:

devtools::install_github('terrytangyuan/lfda')

Citation

Please call citation("lfda") in R to properly cite this software. A white paper is available here.

Examples

Local Fisher Discriminant Analysis(LFDA)

Suppose we want to reduce the dimensionality of the original data set (we are using iris data set here) to 3, then we can run the following:

k <- iris[,-5] # this matrix contains all the predictors to be transformed
y <- iris[,5] # this should be a vector that represents different classes
r <- 3 # dimensionality of the resulting matrix

# run the model, note that two other kinds metrics we can use: 'weighted' and 'orthonormalized'
model <- lfda(k, y, r, metric = "plain") 

plot(model, y) # 3D visualization of the resulting transformed data set

predict(model, iris[,-5]) # transform new data set using predict

Kernel Local Fisher Discriminant Analysis(KLFDA)

The main usage is the same except for an additional kmatrixGauss call to the original data set to perform a kernel trick:

k <- kmatrixGauss(iris[,-5])
y <- iris[,5]
r <- 3
model <- klfda(k, y, r, metric = "plain")

Note that the predict method for klfda is still under development. The plot method works the same way as in lfda.

Semi-supervised Local Fisher Discriminant Analysis(SELF)

This algorithm requires one additional argument such as beta that represents the degree of semi-supervisedness. Let's assume we ignore 10% of the labels in iris data set:

k <- iris[,-5]
y <- iris[,5]
r <- 3
model <- self(k, y, beta = 0.1, r = 3, metric = "plain")

The methods predict and plot work the same way as in lfda.

Integration with {ggplot2::autoplot}

{ggplot2::autoplot} has been integrated with this package. Now {lfda} can be plotted in 2D easily and beautifully using {ggfortify} package. Go to this link and scroll down to the last section for an example.

lfda R

Yuan Tang

Fisher(Local Fisher Discriminant Analysis)Metric Learning(transformation matrix)(class)(between-class distance)(within-class distance)(multimodality)lfda(local structure)lfda

Fisher(Kernel Local Fisher Discriminant Analysis)Fisherkernel trickFisher

Fisher(Semi-supervised Local Fisher Discriminant Analysis)Fisher(Principal Component Analysis)Fisherclass label

lfda

CRAN:

install.packages('lfda')

Github

devtools::install_github('terrytangyuan/lfda')

Fisher - Local Fisher Discriminant Analysis(LFDA)

3

k <- iris[,-5]  #(predictors)
y <- iris[,5]   # (class labels)
r <- 3          # 

# `lfda``metric`'plain', 'weighted', 'orthonormalized' 
model <- lfda(k, y, r, metric = "plain") 

plot(model, y) # 

predict(model, iris[,-5]) # predictlfda

Fisher - Kernel Local Fisher Discriminant Analysis(KLFDA)

klfdalfdalfdakmatrixGauss:

k <- kmatrixGauss(iris[,-5])
y <- iris[,5]
r <- 3
model <- klfda(k, y, r, metric = "plain")

klfdapredictplotlfda

Fisher- Semi-supervised Local Fisher Discriminant Analysis(SELF)

beta beta=0 beta=0 iris10%

k <- iris[,-5]
y <- iris[,5]
r <- 3
model <- self(k, y, beta = 0.1, r = 3, metric = "plain")

predictplotlfda

terrytangyuan@gmail.comPull Request

lfda list of languages used
lfda latest release notes
1.1.2 lfda v1.1.2

R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semi-supervised Local Fisher Discriminant Analysis.

See NEWS for details of changes.

1.1.1 lfda v1.1.1

R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semi-supervised Local Fisher Discriminant Analysis.

See NEWS.md for details of changes.

1.1.0 lfda v1.1.0

R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semi-supervised Local Fisher Discriminant Analysis.

More projects by terrytangyuan View all
Other projects in R