-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow censoring Categorical distributions #7662
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7662 +/- ##
=======================================
Coverage 92.92% 92.92%
=======================================
Files 107 107
Lines 18299 18308 +9
=======================================
+ Hits 17004 17013 +9
Misses 1295 1295
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test for the logcdf
?
res = pt.switch( | ||
def logp(value, p): | ||
k = pt.shape(p)[-1] | ||
value, safe_value_p = Categorical._safe_index_value_p(value, p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love making _safe_index_value_p
a method. What's the conceptual advantage vs just being a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't clutter the namespace, that's the only difference
I did... it's in the Censored. Since there is no Categorical scipy distribution, I would just be comparing two implementations written by me? |
Ah, I tested the logp... hmm okay okay |
a3cbfee
to
60c763f
Compare
lambda value, p: categorical_logpdf(value, p), | ||
) | ||
|
||
def test_categorical_logp_batch_dims(self): | ||
check_selfconsistency_discrete_logcdf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests the logcdf
Reported missing functionality in https://discourse.pymc.io/t/how-to-setup-a-censored-orderedlogistic-model/16451
📚 Documentation preview 📚: https://pymc--7662.org.readthedocs.build/en/7662/