aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala b/mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala
index 3b1caf0c67..63d03347f4 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala
@@ -17,6 +17,7 @@
package org.apache.spark.mllib.clustering
+import org.apache.spark.api.java.JavaRDD
import org.apache.spark.{Logging, SparkException}
import org.apache.spark.annotation.Experimental
import org.apache.spark.graphx._
@@ -116,6 +117,14 @@ class PowerIterationClustering private[clustering] (
}
/**
+ * A Java-friendly version of [[PowerIterationClustering.run]].
+ */
+ def run(similarities: JavaRDD[(java.lang.Long, java.lang.Long, java.lang.Double)])
+ : PowerIterationClusteringModel = {
+ run(similarities.rdd.asInstanceOf[RDD[(Long, Long, Double)]])
+ }
+
+ /**
* Runs the PIC algorithm.
*
* @param w The normalized affinity matrix, which is the matrix W in the PIC paper with