Open BogyeomKim opened 5 months ago
Hi,
I'm just looking into this. Reproducible script would be great!
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
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:
Could you please shed some light on:
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