Skip to content

[Combiner] Add a class for computing variance distributedly#235

Open
Kelvin-Ng wants to merge 1 commit into
husky-team:masterfrom
Kelvin-Ng:variance_combiner
Open

[Combiner] Add a class for computing variance distributedly#235
Kelvin-Ng wants to merge 1 commit into
husky-team:masterfrom
Kelvin-Ng:variance_combiner

Conversation

@Kelvin-Ng

Copy link
Copy Markdown
Contributor

Originally in Random Forest in old Husky.

Now it is useful for @Gyingguo 's data visualization project.

@kygx-legend

Copy link
Copy Markdown
Member

I don't quite understand why put this class in combiner. Is it also a combiner or used by combiner?And could you add the unit test, which help users understand?

@Kelvin-Ng

Copy link
Copy Markdown
Contributor Author

Very rough pseudo code:

auto ch = create_push_combine_channel<SumCombiner<VarianceMeanNum>>();
VarianceMeanNum a(xx, yy, zz);
for all element x in list:
    a += x;
ch.push(0, a);
ch.flush();
ch.get(0).get_variance() // variance of the whole list

@ddmbr

ddmbr commented Feb 6, 2017

Copy link
Copy Markdown
Member

This is to calculate variance/standard deviation incrementally. Obviously it's not easy to give a good name...

@kygx-legend kygx-legend left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think it should have a unit test for this.

Comment thread core/combiner.hpp

class VarianceMeanNum {
public:
VarianceMeanNum() {

@kygx-legend kygx-legend Feb 6, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VarianceMeanNum() : variance_(.0), mean_(.0), num_(0) {}

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

Successfully merging this pull request may close these issues.

3 participants