|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
ac.essex.ooechs.kmeans.KMeansClusterer
public class KMeansAlgorithm
An implementation of the K means clustering algorith, which attempts to find the centroids assumed to be at the center of spherical clusters of points in n dimensional feature space.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected int |
centroidInitialisationStrategy
|
protected java.util.Vector<Centroid> |
centroids
|
static int |
CHOOSE_FIRST_N_POINTS
Centroid initialisation strategy 1: For centroid[i] give it the initial position points[i].position. |
static int |
CHOOSE_RANDOM_POINT_OF_SAME_CLASS
Centroid initialisation strategy 3: Initialise centroids with the position of a random point which has the same classID as the centroid. |
static int |
CHOOSE_RANDOM_POINTS
Centroid initialisation strategy 2: Initialise centroids with the position of a random point. |
protected java.util.Vector<ClusterClass> |
classes
|
protected java.util.Vector<DataPoint> |
points
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
KMeansAlgorithm(int centroidInitialisationStrategy,
java.util.Vector<ClusterClass> classes)
|
Method Summary | |
---|---|
void |
add(DataPoint obj)
|
DataPoint |
getRandomPoint()
Finds a random point. |
DataPoint |
getRandomPoint(ClusterClass c)
Finds a random point with a given classID. |
KMeansSolution |
getSolution()
Returns a cluster solution object which allows the algorithm to be used as a classifier. |
void |
run()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CHOOSE_FIRST_N_POINTS
public static final int CHOOSE_RANDOM_POINTS
public static final int CHOOSE_RANDOM_POINT_OF_SAME_CLASS
protected java.util.Vector<Centroid> centroids
protected java.util.Vector<DataPoint> points
protected java.util.Vector<ClusterClass> classes
protected int centroidInitialisationStrategy
Constructor Detail |
---|
public KMeansAlgorithm(int centroidInitialisationStrategy, java.util.Vector<ClusterClass> classes)
Method Detail |
---|
public void add(DataPoint obj)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public KMeansSolution getSolution()
KMeansSolution
public DataPoint getRandomPoint()
public DataPoint getRandomPoint(ClusterClass c)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |