Open yakir12 opened 4 years ago
I've thought about having Base.empty!
methods that reset the state. I'm hesitant to add empty!
as a required method to the OnlineStatsBase interface, but it would be nice to have those methods around.
Just adding my voice to the choir: it would be pretty nice to have empty!
for OnlineStat
:)
+1 for this. I'd like to use OnlineStats with Distributed.jl by having local stat objects on each processor, and then periodically merge!
them onto stat objects on the driver. Then I'd like to empty the local objects to continue to accumulate stats on each processor. (For https://github.com/ericphanson/TrackingTimers.jl/issues/14). I think this would be much nicer with an empty!
method.
Base.empty!(::OnlineStat)
is an error, but I've added it as an optional part of the interface (via the OnlineStatsBase README).
If anyone wants to knock out a few methods, PRs welcome.
Say I create a vector of
Mean
s. After using that structure, if I want to use it again, I'd need to reset its values first. Right now I need to recreate that structure again. This might be useful only in cases where the structure is really complicated/large.