|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.geometry.cluster.Clusterer
public abstract class Clusterer
A generic interface to a clustering algorithm.
Constructor Summary | |
---|---|
Clusterer()
|
Method Summary | |
---|---|
abstract boolean |
iterate()
Runs a single iteration of the clustering algorithm on the stored data. |
abstract double |
metric()
Calculate a quality metric for the current clustering solution. |
void |
prepare(Point[] points,
int[] ids,
double[][] means,
Region region)
Prepare a clustering pass on the indicated data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Clusterer()
Method Detail |
---|
public void prepare(Point[] points, int[] ids, double[][] means, Region region)
Subclasses can override this to do their own preparation, but must call through to this method.
points
- The array of points to be clustered.ids
- Array of cluster numbers which this call will
fill in, defining which cluster each point
belongs to. The caller must leave the data here
intact between iterations.means
- Array of x,y values in which to place centroids
of the clusters.region
- The region of the plane in which the points lie.public abstract boolean iterate()
prepare(Point[], int[], double[][], Region)
.
After each iteration, the cluster IDs and cluster means should be consistent with each other.
public abstract double metric()
iterate()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |