You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clara already defines mathematical accumulators, such as min and max. Per an offline conversation with a fellow member of the community, they mentioned that it might be nice to also support a median accumulator.
This seems doable, there are a few behavioral details that deserve some thought:
The accum should allow facts to be returned, similar to min/max
1.a. In the event that there are even amounts of facts what should be returned? Both facts?
1.b. Should we allow a comparator function to be provided?
In the event that we have an even amount of items, what value should be returned?
2.a. I think that a simple average would be fine here
@WilliamParker I know you were recently working in this area of code, what are your thoughts?
The text was updated successfully, but these errors were encountered:
This wouldn't be unique to a median accumulator, but would potentially be applicable to min/max as well. I could see uses, but I'd suggest deferring such an addition until/unless there's a need for it. If we do want it it might be best to add it to all of min, max, and median accumulators to maintain consistency.
Regarding 2.2.a
In the same vein as above, I think it would be best to maintain consistency on the returned type signature. I'd prefer to choose either the lower/upper valued fact of the "median pair" to be returned, potentially with the ability to specify which to do. Something likely
It might even make sense to fail if the user passes :returns-fact true and didn't specify that option (with an easily-understood error message), or perhaps just have an arbitrary default.
However, this raises the question - is a :returns-fact true option needed? It might make sense to create this first and then make these decisions with the benefit of additional experience using the accumulator if a :returns-fact true option isn't needed at the moment.
Clara already defines mathematical accumulators, such as min and max. Per an offline conversation with a fellow member of the community, they mentioned that it might be nice to also support a median accumulator.
This seems doable, there are a few behavioral details that deserve some thought:
1.a. In the event that there are even amounts of facts what should be returned? Both facts?
1.b. Should we allow a comparator function to be provided?
2.a. I think that a simple average would be fine here
@WilliamParker I know you were recently working in this area of code, what are your thoughts?
The text was updated successfully, but these errors were encountered: