I’d really like to see an operator for building histograms. It seems a little awkward using the current AFL http://trac.scidb.org/wiki/Docs/Release_11.06/ArrayFunctionalLanguage_11.06. From what I can see, I need to do a filter, count for each bin manually, joining each count together. I guess I’m looking for something with a syntax of:
histogram(input,bins) => array with length = len(bins)+1, given that input is a single-attribute array of any dimensionality, and bins is an array of boundaries between bins, of the same type as the input array. For example, if bins(uint) = [2,3,10], then the histogram would have the following bins:
uint_min <= x < 2
2 <= x < 3
3 <= x < 10
10 <= x < = uint_max
It should be possible to extend this to parameterize the dimensions that are being summarized, e.g., for a video clip of x,y,t, I want to have a histogram that’s count(bin, t) instead of just count(bin).
I’m not sure how this can be elegantly extended to a multi-attribute syntax, but it’s not that important to me since most of the use-cases I can think of involve single-attribute arrays.
Please feel free to point out how this behavior can be synthesized out of trivial combinations of AFL that I have somehow overlooked. I won’t be embarrassed (much).
Just thought this would be a useful feature,