0

Can someone help me out with this problem. I have trying to figure this out from a long time.

I have a training_Set: <1530*270400 double> and Test_Set: <4794*270400 double>

I am using Linear discriminant analysis method

class = classify(Test_Set,Training_Set,train_label,'linear')

Error using classify (line 228)

The pooled covariance matrix of TRAINING must be positive definite.

Om Choudhary
  • 492
  • 1
  • 7
  • 27
  • 1
    Does this answer your question? [The pooled covariance matrix of TRAINING must be positive definite](https://stackoverflow.com/questions/17937609/the-pooled-covariance-matrix-of-training-must-be-positive-definite) – NoDataDumpNoContribution Mar 17 '20 at 16:34

1 Answers1

2

In order for the covariance matrix of TRAINING to be positive definite, you must at the very least have more observations than variables in Test_Set. In your case, it seems as though you have many more variables (270400) than observations (1530). You can try dimension reduction before classifying.

I have answered a very similar question here: Matlab bug with linear discriminant analysis

Community
  • 1
  • 1
Melissa
  • 736
  • 6
  • 8