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

A error in the process of Cross validaition #11

Open
Yung-Chien opened this issue Apr 28, 2022 · 1 comment
Open

A error in the process of Cross validaition #11

Yung-Chien opened this issue Apr 28, 2022 · 1 comment

Comments

@Yung-Chien
Copy link

Hi @haywse @jhmarcus

I 'm trying to run the Cross validaition pipeline like tutorial mentioned, and I got this error in the cv_err command:

>>>cv_err = run_cv(sp_graph, lamb_grid, n_folds=sp_graph.n_observed_nodes, factr=1e10) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/feems/cross_validation.py", line 26, in run_cv sp_graph.fit_null_model(verbose=inner_verbose) File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/feems/spatial_graph.py", line 312, in fit_null_model res = minimize(neg_log_lik_w0_s2, [0.0, 0.0], method="Nelder-Mead", args=(obj)) File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/scipy/optimize/_minimize.py", line 606, in minimize return _minimize_neldermead(fun, x0, args, callback, **options) File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/scipy/optimize/optimize.py", line 689, in _minimize_neldermead fsim[k] = func(sim[k]) File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/scipy/optimize/optimize.py", line 427, in function_wrapper return function(*(wrapper_args + args)) File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/feems/objective.py", line 200, in neg_log_lik_w0_s2 obj.sp_graph.comp_graph_laplacian(obj.sp_graph.w) File "/home/xxx/miniconda3/envs/feems_analysis_e/lib/python3.8/site-packages/feems/spatial_graph.py", line 241, in comp_graph_laplacian self.factor = cholmod.cholesky(self.L_block["dd"]) File "sksparse/cholmod.pyx", line 1188, in sksparse.cholmod.cholesky File "sksparse/cholmod.pyx", line 1216, in sksparse.cholmod._cholesky File "sksparse/cholmod.pyx", line 603, in sksparse.cholmod.Factor._cholesky_inplace File "sksparse/cholmod.pyx", line 598, in sksparse.cholmod.Factor._cholesky_inplace File "sksparse/cholmod.pyx", line 386, in sksparse.cholmod._error_handler sksparse.cholmod.CholmodNotPositiveDefiniteError: ../Supernodal/t_cholmod_super_numeric.c:911: matrix not positive definite (code 1)
So why do I have this question and how could fix this?

Thanks in advances,
Yung-Chien

@VivaswatS
Copy link
Collaborator

Hi @Yung-Chien, we sometimes run into numerical issues like this depending on the data set. I would try figuring out which lambda value causes this and remove it from the grid search. If there are multiple lambda values that give you this same error, it might be symptomatic of some underlying issue with the data

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