Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19340#discussion_r140860281
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeans.scala ---
@@ -546,10 +574,88 @@ object KMeans {
.run(data)
}
+ private[spark] def validateInitMode(initMode: String): Boolean = {
+ initMode match {
+ case KMeans.RANDOM => true
+ case KMeans.K_MEANS_PARALLEL => true
+ case _ => false
+ }
+ }
+ private[spark] def validateDistanceMeasure(distanceMeasure: String):
Boolean = {
+ distanceMeasure match {
+ case DistanceSuite.EUCLIDEAN => true
--- End diff --
I just wanted to be consistent with the similar implementation which is
three lines above. Doing the same thing in two different ways a few lines of
code after might be very confusing IMHO.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]