using PCA as feature extraction

6 views (last 30 days)
hassan hyt
hassan hyt on 28 Feb 2015
Commented: Image Analyst on 28 Feb 2015
I use PCA as a feature extraction tool. in the learning stage I trained the system to choose the best principal component for the training data, for each class(lets say 5 classes ) the system learned for each class what is best principal component to represent the trained data(take the most variance) So I have 5 different principal components(or 5 different sets),So each class will has it's own principal components.
In the testing stage, I think to project the testing data into each principal components, since I have 5 classes which means 5 principal components sets, then I will have 5 feature vector, I will pass those 5 feature vector to classification algorithm one by one, which means I will run the classification 5 times, then I will see what is the best(or maximum) classification result in those 5 classification results, And I will make the decision about. my question is: Is what I do correct?

Answers (1)

Image Analyst
Image Analyst on 28 Feb 2015
I'm not following the numbers, like why everything is 5. Okay, you have 5 classes but why do you think that that means you have 5 principal components? For example, let's say you're classifying faces into race and sex. And you have 2 sexes and 4 races and 1000 faces to be classified. Well, you have 8 classes (4 races x 2 sexes) but you could have dozens of eigenface images, not just 8. Let's say I'm using 20 eigenfaces so for a given face I'd have a vector of 20 weights of those 20 images. Then you need to take those 20 feature vector values and figure out which of the 8 sex/race combinations the image actually is (each class/PC would have 20 weights that define the class). So not everything has to be the same number.
  2 Comments
hassan hyt
hassan hyt on 28 Feb 2015
Edited: hassan hyt on 28 Feb 2015
you misunderstand my question, I don't say I have 5 principal components, I say I will have 5 "sets" each class will have it's own "set" or (it's own principal components). Is it clear now, or do you need more clarification?
Image Analyst
Image Analyst on 28 Feb 2015
We still need more clarification. Sometimes when you try to be too general, it's not clear, whereas it will become more clear if you use specific situation. What are the 5 classes and what are the measurements made on each sample? And how many PCs are in each class?

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!