Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:48:06+00:00 2026-06-04T18:48:06+00:00

I have to write a classificator (gaussian mixture model) that I use for human

  • 0

I have to write a classificator (gaussian mixture model) that I use for human action recognition.
I have 4 dataset of video. I choose 3 of them as training set and 1 of them as testing set.
Before I apply the gm model on the training set I run the pca on it.

pca_coeff=princomp(trainig_data);
score = training_data * pca_coeff;
training_data = score(:,1:min(size(score,2),numDimension));

During the testing step what should I do? Should I execute a new princomp on testing data

new_pca_coeff=princomp(testing_data);
score = testing_data * new_pca_coeff;
testing_data = score(:,1:min(size(score,2),numDimension));

or I should use the pca_coeff that I compute for the training data?

score = testing_data * pca_coeff;
testing_data = score(:,1:min(size(score,2),numDimension));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:48:07+00:00Added an answer on June 4, 2026 at 6:48 pm

    The classifier is being trained on data in the space defined by the principle components of the training data. It doesn’t make sense to evaluate it in a different space – therefore, you should apply the same transformation to testing data as you did to training data, so don’t compute a different pca_coef.

    Incidently, if your testing data is drawn independently from the same distribution as the training data, then for large enough training and test sets, the principle components should be approximately the same.

    One method for choosing how many principle components to use involves examining the eigenvalues from the PCA decomposition. You can get these from the princomp function like this:

    [pca_coeff score eigenvalues] = princomp(data);
    

    The eigenvalues variable will then be an array where each element describes the amount of variance accounted for by the corresponding principle component. If you do:

    plot(eigenvalues);
    

    you should see that the first eigenvalue will be the largest, and they will rapidly decrease (this is called a “Scree Plot”, and should look like this: http://www.ats.ucla.edu/stat/SPSS/output/spss_output_pca_5.gif, though your one may have up to 800 points instead of 12).

    Principle components with small corresponding eigenvalues are unlikely to be useful, since the variance of the data in those dimensions is so small. Many people choose a threshold value, and then select all principle components where the eigenvalue is above that threshold. An informal way of picking the threshold is to look at the Scree plot and choose the threshold to be just after the line ‘levels out’ – in the image I linked earlier, a good value might be ~0.8, selecting 3 or 4 principle components.

    IIRC, you could do something like:

    proportion_of_variance = sum(eigenvalues(1:k)) ./ sum(eigenvalues);
    

    to calculate “the proportion of variance described by the low dimensional data”.

    However, since you are using the principle components for a classification task, you can’t really be sure that any particular number of PCs is optimal; the variance of a feature doesn’t necessarily tell you anything about how useful it will be for classification. An alternative to choosing PCs with the Scree plot is just to try classification with various numbers of principle components and see what the best number is empirically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a simple web app in PHP that needs to have write access
I have to write a function that retrieves some information about some signal handling
i have write a hash code covert method in spring security. In that method,
I have write the code to create the report using itext.For that,i have to
In my app, I have write this code for capture video -(IBAction)takeVideo:(id)sender { [self
I have develop a Telerik Radscheduler in that i have write the code like
<input type=reset/> Can we have write a equivalent action in javascript?
Many of you guys agree that the developers should not have write access to
Suppose that for administrative reasons I do not have write access to module xxx.
I have write one method: -(id)postAndParseJson:(NSMutableDictionary *)theDictionary action:(NSString *)action type:(NSString *)myType { NSString *newJSON

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.