Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset or clear a stats #203

Open
yakir12 opened this issue May 8, 2020 · 4 comments
Open

reset or clear a stats #203

yakir12 opened this issue May 8, 2020 · 4 comments

Comments

@yakir12
Copy link

yakir12 commented May 8, 2020

Say I create a vector of Means. 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.

@joshday
Copy link
Owner

joshday commented May 8, 2020

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.

@torfjelde
Copy link

Just adding my voice to the choir: it would be pretty nice to have empty! for OnlineStat:)

@ericphanson
Copy link

+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 ericphanson/TrackingTimers.jl#14). I think this would be much nicer with an empty! method.

@joshday
Copy link
Owner

joshday commented Jan 18, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants