Constructor
new PowerIterationClustering()
Methods
run(similaritiesOrGraph) → {module:eclairjs/mllib/clustering.PowerIterationClusteringModel}
Run the PIC algorithm on Graph.
Parameters:
Name | Type | Description |
---|---|---|
similaritiesOrGraph |
module:eclairjs.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. |
Returns:
a [[PowerIterationClusteringModel]] that contains the clustering result
setInitializationMode(mode) → {module:eclairjs/mllib/clustering.PowerIterationClustering}
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 |
Returns:
setK(k) → {module:eclairjs/mllib/clustering.PowerIterationClustering}
Set the number of clusters.
Parameters:
Name | Type | Description |
---|---|---|
k |
integer |
Returns:
setMaxIterations(maxIterations) → {module:eclairjs/mllib/clustering.PowerIterationClustering}
Set maximum number of iterations of the power iteration loop
Parameters:
Name | Type | Description |
---|---|---|
maxIterations |
integer |