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

Creating a PIT class instance crashes if the ensemble produces a NaN value #201

Open
3 tasks done
drewoldag opened this issue Oct 31, 2023 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@drewoldag
Copy link
Collaborator

Bug report
To generate the pit samples when instantiating the PIT class, we calculate the CDF for each of the distributions for the input ensemble at the given truth value.

Sometimes, the CDF for a distribution will be NaN at the true value (which may be indicative of a poorly performing model). These NaNs result in a run time error at the end of the initialization when creating an output ensemble.

There are two initial options under consideration:

  1. Replace NaN values in the self._pit_samps array with 0.
  2. Filter out NaN values in the self._pit_samps array.

Option 1 can be accomplished with a mask. Option 2 can be taken care by using np.nanquantile(...) instead of np.quantile(...). np.nanquantile doesn't do anything magical under the hood, it simply removes the NaNs. (Technically, it replaces the NaN values with elements from the end of the input array and returns an array that is shorter by n elements, where n = the number of NaNs.

Before submitting
Please check the following:

  • I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
  • I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead.
  • If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
@drewoldag drewoldag added the bug Something isn't working label Oct 31, 2023
@drewoldag drewoldag self-assigned this Oct 31, 2023
@drewoldag drewoldag removed their assignment Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant