ac.essex.ooechs.kmeans
Class DataPoint

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

public class DataPoint
extends java.lang.Object

This datastructure represents a point of training data in the k means clustering scenario. It consists of a position in n dimensional space and the id of the last centroid it was closest to.


Constructor Summary
DataPoint(double[] positionValues, ClusterClass knownClass)
          Initialises the clusterable point by setting its position in n dimensional space, together with a classID object.
DataPoint(double[] positionValues, int knownClassID)
          Initialises the clusterable point by setting its position in n dimensional space, together with a classID.
 
Method Summary
 Centroid findClosestCentroid(java.util.Vector<Centroid> centroids)
          Finds, from a list of centroids, the centroid that this point is closest to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataPoint

public DataPoint(double[] positionValues,
                 ClusterClass knownClass)
Initialises the clusterable point by setting its position in n dimensional space, together with a classID object.


DataPoint

public DataPoint(double[] positionValues,
                 int knownClassID)
Initialises the clusterable point by setting its position in n dimensional space, together with a classID.

Method Detail

findClosestCentroid

public Centroid findClosestCentroid(java.util.Vector<Centroid> centroids)
Finds, from a list of centroids, the centroid that this point is closest to.


toString

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