File Exchange

image thumbnail

Dimensionality Reduction using Generalized Discriminant Analysis (GDA)

version 1.0.0.0 (5.86 KB) by Mohammad Haghighat
Generalized Discriminant Analysis - a non-linear feature dimensionality reduction technique

6 Downloads

Updated 08 Apr 2016

GitHub view license on GitHub

GDA is one of dimensionality reduction techniques, which projects a data matrix from a high-dimensional space into a low-dimensional space by maximizing the ratio of between-class scatter to within-class scatter.

More details can be found in Section 4.3 of:

M. Haghighat, S. Zonouz, M. Abdel-Mottaleb, "CloudID: Trustworthy cloud-based and cross-enterprise biometric identification," Expert Systems with Applications, vol. 42, no. 21, pp. 7905-7916, 2015.
http://dx.doi.org/10.1016/j.eswa.2015.06.025

(C) Mohammad Haghighat, University of Miami
haghighat@ieee.org
PLEASE CITE THE ABOVE PAPER IF YOU USE THIS CODE.

Cite As

Mohammad Haghighat (2020). Dimensionality Reduction using Generalized Discriminant Analysis (GDA) (https://github.com/mhaghighat/gda), GitHub. Retrieved .

Comments and Ratings (16)

Banafshe Felfeliyan

Banafshe Felfeliyan

darryl tan

Dear Mohammad
i met error with the code.

Error using cell
Size inputs must be scalar.

Error in gda (line 69)
dataCell = cell(1,c);

natalie hu

i also meet some mistakes in your code.
for example:

kernel (line 79)
k = u.'*v; % u'*v

出错 gda (line 89)
Kpq(i,j) = kernel(classP(:,i),classQ(:,j),options);

could you please help me ?

Mike Reno

Jacob

qiang zhang

Dear Mohammad :

Thanks for your codes!

But, there is some error happened when using:

trainGda = gda(trainData,trainData,trainLabel);

The trainData is p*n, where p represent the dimension of features, and the n represent the number of train samples.

The error is:

Error using *
Inner matrix dimensions must agree.

Error in gda (line 103)
zeroMeanKtrain = kTrain - One*kTrain - kTrain*One+One*kTrain*One;

Mohammad Haghighat

Dhurgham Al-karawi:

If you have only two classes, it is not a good idea to use dimensionality reduction methods based on discriminant analysis. Because you will end up with only one feature (C-1). You'd better use PCA.

Dhurgham Al-karawi

Dear Mohammad ,
Thank you for your codes
If it is possible to tell me how can I use your code. I have two classes (180 rows and 2304 columns ).
Dhur.
Regards

Felipe Farias

I have this error:

Error in gda (line 106)
zeroMeanKtrain = kTrain - One*kTrain - kTrain*One+One*kTrain*One;

some one have a solution?
thx

huang hai

First of all, thank you for your contribution.but,I doubt about some place:nDim numerical input won't change any results,Because you didn't use it.You use a parameter is subDim.why?

Mohammad Haghighat

Similar to linear discriminant analysis (LDA), the objective of GDA is to find a projection for the features into a lower dimensional space by maximizing the ratio of between-class scatter to within-class scatter. However, GDA deals with nonlinear discriminant analysis using kernel function operators. GDA method provides a mapping of the input vectors into a high-dimensional feature space, in which linear properties make it easy to extend and generalize the classical LDA to a nonlinear discriminant analysis. Using different kernels, one can cover a wide range of nonlinearities.

Tony

What is the difference between Generalized Discriminant Analysis (GDA) and the Linear Discriminant Analysis (LDA)?

Tony

What is the difference between Generalized Discriminant Analysis (GDA) and the Linear Discriminant Analysis (LDA)?

Mohammad Haghighat

Ali:

Please read the help section of the code. A SAMPLE USE of the code is provided there.

You just need to prepare three matrices including the training data, training labels and test data.
Note that the columns of the trainData and testData represent the feature vectors of the samples in the gallery and probe sets, respectively.
trainLabel is a row vector that contains the class labels for the samples in trainData.

I hope this helps.

ali Hasan

Dear Mohammad
Thank you for your codes
If it is possible to show us how we can use your code by using simple example because there are problems when I used it on my dataset
Regards
Ali

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux