RaviSoji / plda

Probabilistic Linear Discriminant Analysis & classification, written in Python.
https://ravisoji.com
Apache License 2.0
128 stars 31 forks source link

error:"array must not contain infs or NaNs" #57

Closed Xixo99 closed 3 years ago

Xixo99 commented 3 years ago

error:"array must not contain infs or NaNs" image image image

When I use this framework for PLDA experiments, this error often appears. I can guarantee that all my input data are obtained through preprocessing, and they are all positive finite numbers, and the data scale is not large. I don't know why such errors occur. Do you have any additional requirements for the input data?

RaviSoji commented 3 years ago

Do you still have this issue when you reduce the number of principal components to 2? If so, could you run PCA on it and report back the 5-10 largest eigenvalues?

Some other diagnostics:

  1. If you have more than 30 observations, I would use all of them for diagnostic purposes to see whether the issue is that you don't have much variance in the input variables/features. I never tried to fit this model on datasets with less than 300-400 observations.
  2. You also need "enough data" per class label, but to be honest, it's been a years since I've need to use this code, so I can't give you a more useful heuristic than that.

Just a heads up that I may not be too much help in the short term -- trying to meet a few deadlines this week 😅. Ravi B. Sojitra

RaviSoji commented 3 years ago

It's been two weeks without a reply, so I am assuming you figured it out. If not, let me know, and we can keep going back and forth!

Thanks for taking the time to ask about this! Ravi B. Sojitra