Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yanboliang committed Jul 2, 2015
1 parent dd29577 commit 18d803b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/mllib-clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,17 @@ PowerIterationClusteringModel sameModel = PowerIterationClusteringModel.load(sc.

<div data-lang="python" markdown="1">

PowerIterationClustering implements the PIC algorithm. It takes an `RDD` of `(srcId: Long, dstId: Long, similarity: Double)` tuples representing the affinity matrix.
Calling `PowerIterationClustering.run` returns a PowerIterationClusteringModel which contains the computed clustering assignments.
[`PowerIterationClustering`](api/python/pyspark.mllib.html#pyspark.mllib.clustering.PowerIterationClustering)
implements the PIC algorithm.
It takes an `RDD` of `(srcId: Long, dstId: Long, similarity: Double)` tuples representing the
affinity matrix.
Calling `PowerIterationClustering.run` returns a
[`PowerIterationClusteringModel`](api/python/pyspark.mllib.html#pyspark.mllib.clustering.PowerIterationClustering),
which contains the computed clustering assignments.

{% highlight python %}
from __future__ import print_function
from pyspark.mllib.clustering import PowerIterationClustering
from pyspark.mllib.clustering import PowerIterationClustering, PowerIterationClusteringModel

# Load and parse the data
data = sc.textFile("data/mllib/pic_data.txt")
Expand Down

0 comments on commit 18d803b

Please sign in to comment.