-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[ray-data] Add alias parameters to the aggregate function, and add quantile fn #34358
Conversation
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.
API +1 from me, cc @c21 @scottjlee
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.
LGTM, just a couple small nits. Thanks!
Hi,is there any other issues? I will cooperate and correct it in a timely manner. @scottjlee @ericl @scv119 |
Lgtm. I think there's one unresolved comment from Scott above still. |
Looks like there's also a merge conflict with master |
Yes, I don't know if there is a file name conflict. I merged the upstream/master and the conflict was resolved. @ericl |
Merged, thanks! |
Thank you very much. I still have some areas to add or modify in the future, including APIs or new features. |
…antile fn (ray-project#34358) Signed-off-by: elliottower <[email protected]>
…antile fn (ray-project#34358) Signed-off-by: Jack He <[email protected]>
Hi:
I added the alias parameter in the aggregate function and returned the alias. At the same time, I added aggregate function, quantile .
The following is an example of usage :
from ray.data.aggregate import Max, Mean, Min, Quantile, Std
import ray
ls = [
{"A": i, "B": i ** 2}
for i in range(10)]
ds = ray.data.from_items(ls)
ops = [Max("A", alias_name="max_a"), Min("A", alias_name="min_a"), Mean("A", alias_name="mean_a"),
Std("A", alias_name="std_a"),Quantile("A", percent=0.5, alias_name="quantile_a")]
print(dict(ds.aggregate(*ops)))
rs:
{'max_a': 9, 'min_a': 0, 'mean_a': 4.5, 'std_a': 3.0276503540974917, 'quantile_a': 4.5}