Skip to content

Commit

Permalink
Set a random seed in the unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-iskw committed Jul 1, 2015
1 parent 92c3efc commit 220a176
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class KMeansSuite extends SparkFunSuite with MLlibTestSparkContext {

test("fit & transform") {
val predictionColName = "kmeans_prediction"
val kmeans = new KMeans().setK(k).setPredictionCol(predictionColName)
val kmeans = new KMeans().setK(k).setPredictionCol(predictionColName).setSeed(1)
val model = kmeans.fit(dataset)
assert(model.clusterCenters.length === k)

Expand Down

0 comments on commit 220a176

Please sign in to comment.