|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hedgehog.HObject
com.hedgehog.geo.twod.points.KMeansPoint2D
public class KMeansPoint2D
Title: KMeansPoint2D - performs a k-means clustering of 2D points.
Description: Performs a k-means clustering of Point2D points. The k-means algorithm specifies how many cluster centroids (mNumberOfClusters) are to be prescribed. The point set is then partitioned into mNumberOfClusters sub-point sets centred around an associated centroid point. The input is a Point2DSet and the output of the extraction method extractClusters() is an array of sub-cluster points and field mCentroids set to the cluster centroids.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software.
| Field Summary |
|---|
| Fields inherited from class com.hedgehog.HObject |
|---|
mID, mName |
| Constructor Summary | |
|---|---|
KMeansPoint2D()
Default constructor. |
|
KMeansPoint2D(int numberClusters,
int numberIterations,
double tolerance)
Constructor. |
|
| Method Summary | |
|---|---|
double[] |
averageDistanceFromClusterCentroid()
Returns the average distance of each point of the set rom its associated cluster centroid. |
double[] |
clusterStandardDeviations()
Returns the cluster standard deviations from the their average cluster centroid distance. |
void |
extractClusters(Point2DSet pset)
Extracts the clusters from the point set. |
Point2D[] |
getClusterCentroids()
Returns the cluster centroids. |
Point2DSet[] |
getClusterPoints()
Returns the cluster point sets. |
int |
getNumberOfClusters()
Returns the number of clusters. |
int |
getNumberOfIterations()
Returns the maximum number of iterations. |
double |
getTolerance()
Returns the tolerance. |
void |
setNumberOfIterations(int numberOfIterations)
Sets the maximum number of iterations. |
void |
setTolerance(double tolerance)
Sets the tolerance. |
| Methods inherited from class com.hedgehog.HObject |
|---|
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KMeansPoint2D()
public KMeansPoint2D(int numberClusters,
int numberIterations,
double tolerance)
throws java.lang.IllegalArgumentException
numberClusters - The number of clustesrs.numberIterations - The number of iterations. The maximum is 1,000.tolerance - Required tolerance.
java.lang.IllegalArgumentException - Thrown if numberClusters < 1,| Method Detail |
|---|
public Point2D[] getClusterCentroids()
public Point2DSet[] getClusterPoints()
public int getNumberOfClusters()
public int getNumberOfIterations()
public double getTolerance()
public void setNumberOfIterations(int numberOfIterations)
numberOfIterations - The new maximum number of iterations.public void setTolerance(double tolerance)
tolerance - Tolerance.public double[] averageDistanceFromClusterCentroid()
public double[] clusterStandardDeviations()
public void extractClusters(Point2DSet pset)
throws java.lang.IllegalArgumentException
pset - Point set.
java.lang.IllegalArgumentException - Thrown if pset is null or empty.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||