Multiple statistics with multiple variables
Moelf opened this issue · comments
Jerry Ling commented
I know fit!()
works with an iterator, but what if I need to return multiple pairs of (value, weight)
from the iterator because I want to make many weighted histograms in one pass of the data?
Josh Day commented
Can you clarify a bit? I don't think I follow.
Jerry Ling commented
taking this example from docs:
itr = (row.variety => parse(Float64, row.sepal_length) for row in rows)
o = GroupBy(String, Hist(4:0.25:8))
fit!(o, itr)
What if:
- each observation from
itr
has a weight (histogram filling weight) - Each Histogram has different binning (say "Setosa" has
4:0.5:8
, and "Virginica" has6:0.25:8
)
Josh Day commented
You may have to roll a few things on your own.
Also, I've been meaning to work on StatsBase-like weights for OnlineStats so maybe this will nudge me to do it.
Jerry Ling commented
in case you want wheels:
https://github.com/Moelf/FHist.jl/blob/0c3dfdf118600507fa6a38aa0208a855d1347fa3/src/hist1d.jl#L90