public interface EigenCut
Matrix
.
This interface is based on the spectral clustering algorithm described in the
following two papers:
getLeftCut
and
the "right" side of the cut should be made accessible by getRightCut
.
Once the data matrix has been split until every data point is in it's own
partition, the algorithm merges portions of the tree using one of two
objective functions. The first, and most often used, is a relaxed
correlation objective function. This method balances inter cluster
similarity and intra cluster dissimilarity, with a varying weight between
the two scores. getMergedObjective(double, double)
and getSplitObjective(double, double, int, int[], int, int[])
compute this objective function, with the first method computing the score
when the full data matrix is used and the second method computing the score
accross a given set of paritions. The second objective function is the
standard k-means objective function. getKMeansObjective()
computes
this, with one method computing the objective of the data set as a single
cluster and the other method computing the objective over a given set of
clusters.BaseSpectralCut
Modifier and Type | Method and Description |
---|---|
void |
computeCut(Matrix matrix)
Compute the cut with the lowest conductance for the data set.
|
DoubleVector |
computeRhoSum(Matrix matrix)
Computes the similarity between each data point and centroid of the data
set.
|
double |
getKMeansObjective()
Returns the K-Means objective score of the entire data set, i.e.
|
double |
getKMeansObjective(double alpha,
double beta,
int leftNumClusters,
int[] leftAssignments,
int rightNumClusters,
int[] rightAssignments)
Returns the K-Means objective computed over the two regions computed over
the data set.
|
Matrix |
getLeftCut()
Returns the data set in the first (left) region.
|
int[] |
getLeftReordering()
Return the ordering of the first region with respect to the original data
set.
|
double |
getMergedObjective(double alpha,
double beta)
Returns the score for the relaxed correlation objective over the entire
data set, undivided.
|
Matrix |
getRightCut()
Returns the data set in the second (right) region.
|
int[] |
getRightReordering()
Return the ordering of the second region with respect to the original
data set.
|
double |
getSplitObjective(double alpha,
double beta,
int leftNumClusters,
int[] leftAssignments,
int rightNumClusters,
int[] rightAssignments)
Returns the score for the relaxed correlation objective when the data
matrix is divided into multiple clusters.
|
double |
rhoSum()
Returns the sum of values in
rho . |
double rhoSum()
rho
. This is equivalent to
sum(matrix
* matrix
').DoubleVector computeRhoSum(Matrix matrix)
matrix
.void computeCut(Matrix matrix)
getLeftCut()
and getRightCut()
.int[] getLeftReordering()
Matrix getLeftCut()
Matrix getRightCut()
int[] getRightReordering()
double getKMeansObjective()
double getKMeansObjective(double alpha, double beta, int leftNumClusters, int[] leftAssignments, int rightNumClusters, int[] rightAssignments)
double getSplitObjective(double alpha, double beta, int leftNumClusters, int[] leftAssignments, int rightNumClusters, int[] rightAssignments)
alpha
- The weight given to the inter-cluster similarity.beta
- The weight given to the intra-cluster similarity.leftNumClusters
- The number of clusters found in the left splitleftAssignments
- The assignments for data points in the left regionrightNumClusters
- The number of clusters found in the right splitrightAssignments
- The assignments for data points in the right
regiondouble getMergedObjective(double alpha, double beta)
Copyright © 2012. All Rights Reserved.