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

Fix return value of Kmeans.summarize #618

Merged
merged 1 commit into from
Sep 4, 2019
Merged

Conversation

alexhenrie
Copy link
Contributor

total_dist was being used (via the += operator) while it was still initialized to a garbage value. At the same time, pdist was being unnecessarily initialized at the beginning of the function only to be initialized later before it is used. So I'm guessing that you meant to put the = 0.0 on the declaration of total_dist but accidentally put it on pdist instead.

@jmschrei
Copy link
Owner

jmschrei commented Sep 4, 2019

Good catch. Fortunately it seems like the only thing it could potentially effect is the number of iterations for training if not manually set.

@jmschrei
Copy link
Owner

jmschrei commented Sep 4, 2019

This probably also explains why k-means related unit tests would fail occasionally but be fixed by re-running them.

@jmschrei jmschrei merged commit 948aaf4 into jmschrei:master Sep 4, 2019
@alexhenrie alexhenrie deleted the kmeans branch September 4, 2019 17:42
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.

2 participants