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

pearsonr_mat sometimes throws divide by zero error if simulation finishes without any elution #151

Closed
ronald-jaepel opened this issue Jun 26, 2024 · 1 comment

Comments

@ronald-jaepel
Copy link
Collaborator

On an optimization I'm running the

def pearsonr_mat(x, Y, times):

sometimes throws an error

  File "/home/IBT/jaepel/miniforge3/envs/CADETProcessGP/lib/python3.10/site-packages/CADETProcess/comparison/difference.py", line 279, in evaluate
    metric = self._evaluate(solution)
  File "/home/IBT/jaepel/miniforge3/envs/CADETProcessGP/lib/python3.10/site-packages/CADETProcess/comparison/difference.py", line 582, in _evaluate
    corr, offset_original = pearson(
  File "/home/IBT/jaepel/miniforge3/envs/CADETProcessGP/lib/python3.10/site-packages/CADETProcess/comparison/shape.py", line 194, in pearson
    pearson = eval_offsets(
  File "/home/IBT/jaepel/miniforge3/envs/CADETProcessGP/lib/python3.10/site-packages/CADETProcess/comparison/shape.py", line 129, in eval_offsets
    scores = pearsonr_mat(reference_data, rol_mat, time)
ZeroDivisionError: division by zero

When debugging, I can see that the simulation in this case was only fluctuations around 1e-13. I didn't think to save the sim results and it takes ages to get back to that point in the optimization (~2h) so I'll export a dataset for easier debugging next week.

@ronald-jaepel
Copy link
Collaborator Author

Closed by #155

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