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

add categorical moment #5176

Merged
merged 2 commits into from
Nov 13, 2021
Merged

Conversation

farhanreynaldo
Copy link
Contributor

Add moments and tests for the below distributions as part of #5078:

  • pymc.distributions.discrete.Categorical

@codecov
Copy link

codecov bot commented Nov 12, 2021

Codecov Report

Merging #5176 (d9c5309) into main (275c145) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5176      +/-   ##
==========================================
- Coverage   78.09%   78.08%   -0.02%     
==========================================
  Files          88       88              
  Lines       14149    14166      +17     
==========================================
+ Hits        11050    11061      +11     
- Misses       3099     3105       +6     
Impacted Files Coverage Δ
pymc/distributions/discrete.py 98.30% <100.00%> (-1.12%) ⬇️
pymc/bart/pgbart.py 96.24% <0.00%> (-0.38%) ⬇️
pymc/smc/smc.py 98.30% <0.00%> (-0.05%) ⬇️
pymc/initial_point.py 100.00% <0.00%> (ø)
pymc/distributions/continuous.py 96.44% <0.00%> (+0.06%) ⬆️
pymc/distributions/multivariate.py 71.47% <0.00%> (+0.19%) ⬆️

@ricardoV94 ricardoV94 mentioned this pull request Nov 12, 2021
51 tasks
@pytest.mark.parametrize(
"p, size, expected",
[
(np.arange(0.1, 0.4, 0.1), None, 3),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but can we perhaps have some of the tests have the moment not be the last element?

Also for readability defining the p explicitly such as np.array([.6, .1, .3]) seems better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sure, I agree it is not really readable.

@ricardoV94
Copy link
Member

Looks good, just checking if the tests pass

@ricardoV94 ricardoV94 merged commit 140dab0 into pymc-devs:main Nov 13, 2021
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