public class NeighborChainAgglomerativeClustering extends Object implements Clustering
SimilarityFunction
.
This implementation is based on the following paper:
Modifier and Type | Class and Description |
---|---|
static class |
NeighborChainAgglomerativeClustering.ClusterLink
The similarity method used when comparing and merging compelte clusters.
|
static class |
NeighborChainAgglomerativeClustering.Link
A simple struct for storing links between two clusters.
|
Constructor and Description |
---|
NeighborChainAgglomerativeClustering()
Creates a
NeighborChainAgglomerativeClustering with no minimum
similarity threshold. |
NeighborChainAgglomerativeClustering(NeighborChainAgglomerativeClustering.ClusterLink method,
SimilarityFunction simFunc)
Creates a
NeighborChainAgglomerativeClustering with the specified
minimum similarity threshold. |
Modifier and Type | Method and Description |
---|---|
Assignments |
cluster(Matrix m,
int numClusters,
Properties props)
Returns the agglomerative clustering result using
NeighborChainAgglomerativeClustering.ClusterLink and
SimilarityFunction specified from the constructor. |
Assignments |
cluster(Matrix m,
Properties props)
Unsupported
|
static Assignments |
clusterAdjacencyMatrix(Matrix adj,
NeighborChainAgglomerativeClustering.ClusterLink method,
int numClusters)
Clusters the points represented as an adjacency matrix in
adj
using the supplied ClusterLink method into numCluster . |
static Assignments |
formAssignments(Collection<Set<Integer>> clusters,
int numPoints)
Returns the
Assignments corresponding to the set of clusters and
number of data points. |
public NeighborChainAgglomerativeClustering()
NeighborChainAgglomerativeClustering
with no minimum
similarity threshold. When using this constructor, you must specifcy the
number of clusters or the results will be undefined.public NeighborChainAgglomerativeClustering(NeighborChainAgglomerativeClustering.ClusterLink method, SimilarityFunction simFunc)
NeighborChainAgglomerativeClustering
with the specified
minimum similarity threshold. When clustering without specifying the
number of clusters, clustering stops when the most similar clusters have
a similarity below this threshold.public Assignments cluster(Matrix m, Properties props)
cluster
in interface Clustering
m
- the Matrix
whose row data points are to be
clusteredprops
- the properties to use for any parameters each clustering
algorithm may needAssignment
instances that indicate zero or
more clusters to which each row belongs.UnsupportedOperationException
public Assignments cluster(Matrix m, int numClusters, Properties props)
NeighborChainAgglomerativeClustering.ClusterLink
and
SimilarityFunction
specified from the constructor. The SimilarityFunction
will be used to build a symmetric adjacency matrix
and the NeighborChainAgglomerativeClustering.ClusterLink
will determine how to udpate similarities
between newly nerged clusters.cluster
in interface Clustering
m
- the Matrix
whose row data points are to be
clusterednumClusters
- the number of clusters to generateprops
- the properties to use for any parameters each clustering
algorithm may needAssignment
instances that indicate zero or
more clusters to which each row belongs.public static Assignments clusterAdjacencyMatrix(Matrix adj, NeighborChainAgglomerativeClustering.ClusterLink method, int numClusters)
adj
using the supplied ClusterLink
method into numCluster
.adj
- A symmetric Matrix
recording similarities between
nodes in a graph.method
- NeighborChainAgglomerativeClustering.ClusterLink
method that determines how similarities
between clusters will be updated.numClusters
- The desired number of clusters.Assignments
from each data point to it's assigned
cluster.public static Assignments formAssignments(Collection<Set<Integer>> clusters, int numPoints)
Assignments
corresponding to the set of clusters and
number of data points.Copyright © 2012. All Rights Reserved.