Skip to content

[ML] skip calculation of influencer probabilities if no influences specified #149

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

Merged
merged 2 commits into from
Jul 11, 2018

Conversation

hendrikmuhs
Copy link

skip calculation of influencer probabilities if no influences specified

Copy link
Contributor

@edsavage edsavage left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@tveasey tveasey left a comment

Choose a reason for hiding this comment

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

I think the idea is fine. I'd just suggest you skip even a little more.

I don't think this needs another review.

@@ -761,6 +761,11 @@ bool CProbabilityAndInfluenceCalculator::calculate(

LOG_TRACE(<< "probability = " << probability);

if (m_InfluencerProbabilities.empty() == true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought our guidelines was to prefer == false to !, but I'm not sure about == true this looks a bit funny to me. Also, I think this can safely go before if (!m_Probability.calculate(probability)) to skip more redundant work; I don't actually think it is appropriate to return false in this case either if that were to fail.

Copy link
Author

@hendrikmuhs hendrikmuhs Jul 10, 2018

Choose a reason for hiding this comment

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

fair enough, I was unsure myself if I should add the redundant == true, will remove that.

I wonder about the suggestions to move it up, probability is an out parameter and according to my investigations this is important to be calculated independent of influencers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder about the suggestions to move it up, probability is an out parameter

Sorry, yes you are completely right I didn't read this carefully.

@hendrikmuhs hendrikmuhs merged commit 7164f46 into elastic:master Jul 11, 2018
hendrikmuhs pushed a commit to hendrikmuhs/ml-cpp that referenced this pull request Jul 11, 2018
…ecified (elastic#149)

skip calculation of influencer probabilities if no influences specified
hendrikmuhs pushed a commit that referenced this pull request Jul 11, 2018
…ecified (#149)

skip calculation of influencer probabilities if no influences specified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants