-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Incremental weighted mean and var #15798
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
Incremental weighted mean and var #15798
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Do you think then that adding sample_weight
support to _incremental_mean_and_var
would be more difficult to maintain then creating a separate method?
I see two possibiliites:
I would rather have separate methods, but I'm opened for arguments/propostitions. |
bd4c1d8
to
acd5afb
Compare
a046d24
to
3160df3
Compare
3160df3
to
9d3115f
Compare
Testing is done and I believe code is ready to be reviewed. |
It's really quite inconvenient that you close and reopen this issue. it provides no link between the old and new issues, means that the labels on the previous issue are removed, etc. Please avoid this in the future. |
True, it was misguided decision, mea culpa. |
Reference Issues/PRs
Partially adresses: #15601
What does this implement/fix? Explain your changes.
Method partial_fit in StandardScaler can be used multiple times to incrementally update mean and variance, but there was no proper method to do it with sample_weights. This PR introduce _incremental_weighted_mean_and_var, which does the exact thing we want.
Any other comments?