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

SVD Not Converging #193

Open
BogyeomKim opened this issue Apr 7, 2024 · 2 comments
Open

SVD Not Converging #193

BogyeomKim opened this issue Apr 7, 2024 · 2 comments

Comments

@BogyeomKim
Copy link

BogyeomKim commented Apr 7, 2024

Hello. This is Bogyeom Kim.

I've been using the SCCA_PMD function from the cca_zoo package for Sparse Canonical Correlation Analysis on my datasets. However, I've encountered a recurring error related to SVD not converging: i = 1, SVD did not converge.

I also encountered a recurring error following below:
/home/connectome/kimbo/.conda/envs/bct_cca/lib/python3.8/site-packages/cca_zoo/models/_rcca.py:123: RuntimeWarning: invalid value encountered in sqrt / np.sqrt(eigvals[idx]) /home/connectome/kimbo/.conda/envs/bct_cca/lib/python3.8/site-packages/cca_zoo/models/_iterative/_base.py:154: UserWarning: Some scores are nan. Usually regularisation is too high. warnings.warn( /home/connectome/kimbo/.conda/envs/bct_cca/lib/python3.8/site-packages/cca_zoo/models/_iterative/_base.py:105: RuntimeWarning: invalid value encountered in divide return residual - np.outer(score, score) @ residual / np.dot(score, score) /home/connectome/kimbo/.conda/envs/bct_cca/lib/python3.8/site-packages/cca_zoo/models/_iterative/_base.py:92: UserWarning: Inner loop 31 not converged. Increase number of iterations. warnings.warn( /home/connectome/kimbo/.conda/envs/bct_cca/lib/python3.8/site-packages/numpy/lib/function_base.py:2854: RuntimeWarning: invalid value encountered in divide c /= stddev[:, None] /home/connectome/kimbo/.conda/envs/bct_cca/lib/python3.8/site-packages/numpy/lib/function_base.py:2855: RuntimeWarning: invalid value encountered in divide c /= stddev[None, :]

Here's a brief overview of my process:

  • The datasets have been scaled. I've checked the mean and std of the datasets.
  • Penalties were determined through a grid search, resulting in a penalty setting of (0.9, 0.9) for both datasets.
    Despite these adjustments, the SVD convergence issue persists.

Could you please shed some light on:

  1. The specific part of the SCCA_PMD process where SVD is applied?
  2. Any recommendations or steps I might take to resolve the SVD convergence issue within the context of SCCA_PMD?

Any insights or suggestions you could provide would be greatly appreciated. I've ensured the data scaling was appropriately applied and hoped the penalty parameters from the grid search would suffice, but it seems there may be other factors at play affecting SVD convergence.

Thank you for your time and for developing such a useful tool.

Best regards,
Bogyeom Kim

@jameschapman19
Copy link
Owner

Hi,

I'm just looking into this. Reproducible script would be great!

@jameschapman19
Copy link
Owner

So one thing to say is in more recent versions I have changed SCCA_PMD to SPLS. Later versions should in general be much better/fewer bugs.

I'd need to see where the SVD error is coming from a printout say to even have a chance of working this one out.

Basically I'd try using a more recent version

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

2 participants