The specification states that the function passed to Categorize, quantity, takes a data point and returns a double. I feel like a more appropriate name may be category, as well as the correction that it should return a string.
That's a copy-paste error. The function accepted by Categorize takes a function that returns a string. The Scala implementation is explicit about that.
The specification states that the function passed to
Categorize
,quantity
, takes a data point and returns adouble
. I feel like a more appropriate name may becategory
, as well as the correction that it should return astring
.Source