Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/117#discussion_r10776514
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeans.scala ---
@@ -114,27 +126,60 @@ class KMeans private (
* performance, because this is an iterative algorithm.
*/
def run(data: RDD[Array[Double]]): KMeansModel = {
- // TODO: check whether data is persistent; this needs RDD.storageLevel
to be publicly readable
+ run(data.map(v => Vectors.dense(v)))
+ }
+
+ /**
+ * Train a K-means model on the given set of points; `data` should be
cached for high
+ * performance, because this is an iterative algorithm.
+ */
+ def run(data: RDD[Vector])(implicit d: DummyImplicit): KMeansModel = {
--- End diff --
Yes, it is due to type erasure. I can change the old method to `runRaw`,
deprecate it, and update Python/Java APIs.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---