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
ENH: stats.fisher_exact: convert output tuple to Bunch #16407
Conversation
Thanks @JozsefKutas. At first glance, this looks great! Let's see what another maintainer thinks of gh-16387, and if that looks OK to them, I'll review/merge this and other follow-ups. |
scipy/stats/_stats_py.py
Outdated
FisherExactResult = _make_tuple_bunch('FisherExactResult', | ||
['statistic', 'pvalue'], []) |
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 would prefer to have a common "tuple bunch" as I said in the other PR from @mdhaber. Otherwise I am +1 on doing this.
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.
Ok, what should the name be? StatsTestResult
?
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.
Might be too general. What about HypothesisTestResult
? Not sure if there would be something that would just say p-value and statistic. SignificanceTestResult
maybe?
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.
Is combine_pvalues
well-described by "hypothesis test"? Not sure, but I like a slight tweak of what you wrote: I think SignificanceResult
is a good name for an object with just attributes statistic
and pvalue
.
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.
Let's go with that then 👍
OK I just changed gh-16387 to |
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.
Merged main so we could use SignificanceResult
and parametrize
d test.
@JozsefKutas do these changes look good to you? If so, I'll merge, and we can continue down the list - just like this is great, I think.
Yup, that seems fine to me. For the other statistical functions, both |
Yup, I think so. We can consider consolidating similar result objects later. |
Thanks @JozsefKutas @tupui! |
Reference issue
#16364
#13118
What does this implement/fix?
#16364 suggests that all statistical functions that currently return tuples should return Bunch objects. This PR converts the tuple returned by stats.fisher_exact to a Bunch.