Class: PowerIterationClustering

eclairjs/mllib/clustering.PowerIterationClustering

Constructs a PIC instance with default parameters: {k: 2, maxIterations: 100, initMode: "random"}.

Constructor

new PowerIterationClustering()

Source:

Methods

run(similaritiesOrGraph) → {module:eclairjs/mllib/clustering.PowerIterationClusteringModel}

Run the PIC algorithm on Graph.
Parameters:
Name Type Description
similaritiesOrGraph module:eclairjs/rdd.RDD | Graph an RDD of (i, j, s,,ij,,) tuples representing the affinity matrix, which is the matrix A in the PIC paper. The similarity s,,ij,, must be nonnegative. This is a symmetric matrix and hence s,,ij,, = s,,ji,,. For any (i, j) with nonzero similarity, there should be either (i, j, s,,ij,,) or (j, i, s,,ji,,) in the input. Tuples with i = j are ignored, because we assume s,,ij,, = 0.0. Or a graph an affinity matrix represented as graph, which is the matrix A in the PIC paper. The similarity s,,ij,, represented as the edge between vertices (i, j) must be nonnegative. This is a symmetric matrix and hence s,,ij,, = s,,ji,,. For any (i, j) with nonzero similarity, there should be either (i, j, s,,ij,,) or (j, i, s,,ji,,) in the input. Tuples with i = j are ignored, because we assume s,,ij,, = 0.0.
Source:
Returns:
a [[PowerIterationClusteringModel]] that contains the clustering result
Type
module:eclairjs/mllib/clustering.PowerIterationClusteringModel

run2(similarities) → {module:eclairjs/mllib/clustering.PowerIterationClusteringModel}

A Java-friendly version of run.
Parameters:
Name Type Description
similarities JavaRDD
Source:
Returns:
Type
module:eclairjs/mllib/clustering.PowerIterationClusteringModel

setInitializationMode(mode)

Set the initialization mode. This can be either "random" to use a random vector as vertex properties, or "degree" to use normalized sum similarities. Default: random.
Parameters:
Name Type Description
mode string
Source:
Returns:

setK(k) → {module:eclairjs/mllib/clustering.PowerIterationClustering}

Set the number of clusters.
Parameters:
Name Type Description
k number
Source:
Returns:
Type
module:eclairjs/mllib/clustering.PowerIterationClustering

setMaxIterations(maxIterations) → {module:eclairjs/mllib/clustering.PowerIterationClustering}

Set maximum number of iterations of the power iteration loop
Parameters:
Name Type Description
maxIterations number
Source:
Returns:
Type
module:eclairjs/mllib/clustering.PowerIterationClustering