ac.essex.ooechs.kmeans
Class Centroid
java.lang.Object
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)
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 |
position
protected Position position
members
protected java.util.Vector<DataPoint> members
clusterClass
protected ClusterClass clusterClass
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 toposition
- The centroid's position in n dimensional space
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