-
Notifications
You must be signed in to change notification settings - Fork 41
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
RFC: add quantile
?
#795
Comments
Thanks for the proposal @mdhaber. I don't quite have an opinion yet - I think it in part depends on the situation with methods (see below). Also - how much do you actually need this? I only count two instances of it being used in SciPy, one of which is a test case. I just did a grep, so I may be missing some dynamic usage perhaps. The one instance is pretty simple, no keyword usage:
Which ones? Could we get away with only a default method, and hence no
|
Related is our previous discussion on |
Personally, I don't need it very badly. You're right that
One wrench I'd like to throw into my own proposal: |
I did a bit of digging, with the disclaimer that my digging is incomplete, but I'll try to summarize my initial findings below. OverviewI took a peak at which APIs were implemented across array libraries, spot-checked whether/how they were implemented, and did a search for which APIs were used in SciPy and sklearn. medianUsageImplementations
quantileUsageImplementations
percentileUsageImplementations
partitionImplementations
|
I reviewed
There are also uses of Most of these functions have something else that would make array API conversion challenging at the moment, but I don't think any have non-starters for array API support. I've omitted uses I don't think will get array API support any time soon (e.g. |
I'm working on adding array API support in
scipy.stats
(scipy/scipy#20544) and one of the the things I'll need is aquantile
function. If there is some support for this idea, I'll convert this issue into a proper proposal.Looks like there is already wide support:
numpy.quantile
torch.quantile
cupy.quantile
jax.numpy.quantile
dask.dataframe.DataFrame.quantile
tfp.stats.quantiles
xarray.DataArray.quantile
Previous discussions (not much):
There are many conventions for calculating quantiles. Only a few methods would be required by the standard, and if choice of a default is too contentious, perhaps the array-API can consider
method
to be a required keyword argument, and libraries would be welcome to keep their own default.The text was updated successfully, but these errors were encountered: