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

refactor: Categorical now stores normalized values for cdf and sf #301

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FreezyLemon
Copy link
Contributor

(De)normalization needs to be done on every cdf- or sf-related API call at the moment. It's much simpler to handle it like the pmf vector and just do it once in new.

This breaks multinomial because it uses some of the Categorical helper functions in its implementation. This PR depends on another one resolving this, e.g. #287.

FreezyLemon and others added 2 commits September 24, 2024 00:06
norm_pmf (probabilities) was already normalized before
storing, but cdf and sf weren't. Instead, they were normalized
on every API call.

The refactor also reduces the amount of vec/slice iterations in `new`
from 4 to 2.
@YeungOnion YeungOnion added this to the 0.18 milestone Sep 25, 2024
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

Successfully merging this pull request may close these issues.

2 participants