Skip to content

Conversation

jkbradley
Copy link
Member

Issues:

  • From JIRA: GaussianMixtureEM uses randomness but does not take a random seed. It should take one as a parameter.
  • This also makes the test suite flaky since initialization can fail due to stochasticity.

Fix:

  • Add random seed
  • Use it in test suite

CC: @mengxr @tgaloppo

@jkbradley
Copy link
Member Author

Btw, in the docs, I did not say that the random seed is only used for initializing clusters since we may want to use it elsewhere in the future.

@mengxr
Copy link
Contributor

mengxr commented Jan 9, 2015

LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

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

For the single cluster case, I don't think the seed can make a difference. With only one cluster, this just makes sure the right mean and covariance are computed correctly.

Copy link
Member Author

Choose a reason for hiding this comment

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

In general, you're correct. The issue is that, with some probability, the 5 data points chosen for initializing the cluster will be identical, causing initialization of the covariance matrix to fail.

I'd be fine with having this test use only 1 random seed instead of 5, but it's fast anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it!

@SparkQA
Copy link

SparkQA commented Jan 9, 2015

Test build #25333 has finished for PR 3981 at commit f0df4fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@mengxr
Copy link
Contributor

mengxr commented Jan 9, 2015

Merged into master.

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.

4 participants