Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorPCA yields complex data type array which causes error in Ridge module #8

Open
jagandecapri opened this issue Sep 30, 2021 · 0 comments

Comments

@jagandecapri
Copy link

Hi @FilippoMB,

I noticed that for the dataset that I'm using, the result of tensorPCA yields a complex data type Numpy array. This in turn causes an error in the ridge module which says that it does not support complex data type. Specifically, error ValueError: Complex data not supported is generated at https://github.com/FilippoMB/Time-series-classification-and-clustering-with-Reservoir-Computing/blob/master/code/modules.py#L205

I don't face this issue when I use PCA with the same dataset.

I tried to print out the eigenvalue and eigenvector data type at https://github.com/FilippoMB/Time-series-classification-and-clustering-with-Reservoir-Computing/blob/master/code/tensorPCA.py#L33-L38 and both these vectors are of the data type, complex128, for the dataset I am using.

I tried Googling a bit and found some resources such as https://stackoverflow.com/questions/10420648/complex-eigen-values-in-pca-calculation and https://stackoverflow.com/questions/48695430/how-to-make-the-eigenvalues-and-eigenvectors-stay-real-instead-of-complex. From what I understood, due to some numerical error, the eigenvalues and eigenvectors can have a small imaginary value when linalg.eig is used. I'm not sure whether my understanding is correct.

Any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant