ac.essex.ooechs.kmeans
Class Centroid

java.lang.Object
  extended by ac.essex.ooechs.kmeans.Cluster

public class Centroid
extends java.lang.Object

A Centroid is a position in N dimensional space, supposedly in the center of a cluster of points. In this case it is represented by a position, a reference to a cluster class (for classification) and a vector of members (for the training part)


Field Summary
protected  ClusterClass clusterClass
           
protected  java.util.Vector<DataPoint> members
           
protected  Position position
           
 
Constructor Summary
Centroid(ClusterClass clusterClass, Position position)
          Initialises the centroid.
 
Method Summary
 void clearPoints()
          Clears out all points registered with this centroid.
 void registerPoint(DataPoint object)
          Registers an object whose closest centroid is this one.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

position

protected Position position

members

protected java.util.Vector<DataPoint> members

clusterClass

protected ClusterClass clusterClass
Constructor Detail

Centroid

public Centroid(ClusterClass clusterClass,
                Position position)
Initialises the centroid. Every centroid has a position and is associated with a particular class.

Parameters:
clusterClass - The class that this centroid attempts to
position - The centroid's position in n dimensional space
Method Detail

registerPoint

public void registerPoint(DataPoint object)
Registers an object whose closest centroid is this one. This information is used to update the Centroid's position.


clearPoints

public void clearPoints()
Clears out all points registered with this centroid.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object