Class AlgorithmLBG

java.lang.Object
  extended by Algorithm
      extended by AlgorithmLBG
All Implemented Interfaces:
java.lang.Runnable

public class AlgorithmLBG
extends Algorithm

implements the LBG algorithm


Constructor Summary
AlgorithmLBG()
           
 
Method Summary
 void classify(java.util.Vector guesses)
          Classifies the data sets based on the k-means iterative algorithm
 MyPoint clusterDeviation(java.util.Vector cluster, MyPoint mean)
          Calculates the standard deviation of the cluster
 void computeBinaryDeviates(java.util.Vector decisionRegions)
          Computes the binary deviates after each iteraion
 int displayClusterError(int closest, java.util.Vector cluster, int id)
          Finds the datapoints in error, for all datasets
 void generatePool()
          Collects all the data points together
 int getClosestSet(MyPoint mean)
          Determines the closest data sets to the cluster
 java.util.Vector<MyPoint> getDecisionRegion(java.util.Vector<MyPoint> vec)
          Computes the k-mean decision region - nearest neighbor algorithm
 boolean initialize()
          Overrides the initialize() method in the base class.
 void outputDecisionRegion()
          Displays the decision regoin on output panel
 void run()
          Implementation of the run function from the Runnable interface.
 
Methods inherited from class Algorithm
computeMeans, disableControl, enableControl, nextStep, prevStep, scaleToFitData, setDataPoints, setOutputPanel, setProcessBox
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmLBG

public AlgorithmLBG()
Method Detail

initialize

public boolean initialize()
Overrides the initialize() method in the base class. Initializes member data and prepares for execution of first step. This method "resets" the algorithm.

Specified by:
initialize in class Algorithm
Returns:
Returns true

run

public void run()
Implementation of the run function from the Runnable interface. Determines what the current step is and calls the appropriate method.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class Algorithm

generatePool

public void generatePool()
Collects all the data points together


getClosestSet

public int getClosestSet(MyPoint mean)
Determines the closest data sets to the cluster

Parameters:
mean - mean point of the cluster
Returns:
closest data set to the cluster

displayClusterError

public int displayClusterError(int closest,
                               java.util.Vector cluster,
                               int id)
Finds the datapoints in error, for all datasets

Parameters:
closest - Variable can be int values 1-4. Marks which set of data is closest
cluster - Stores the points of a cluster
id - ID number
Returns:
Returns the error number of the misclassified samples

computeBinaryDeviates

public void computeBinaryDeviates(java.util.Vector decisionRegions)
Computes the binary deviates after each iteraion

Parameters:
decisionRegions - region: classified data sets

clusterDeviation

public MyPoint clusterDeviation(java.util.Vector cluster,
                                MyPoint mean)
Calculates the standard deviation of the cluster

Parameters:
cluster - cluster of data points
mean - mean of the cluster
Returns:
MYPoint standard deviation of the cluster along x direction and y direction.
See Also:
MyPoint

classify

public void classify(java.util.Vector guesses)
Classifies the data sets based on the k-means iterative algorithm

Parameters:
guesses - stored data sets from the classification

getDecisionRegion

public java.util.Vector<MyPoint> getDecisionRegion(java.util.Vector<MyPoint> vec)
Computes the k-mean decision region - nearest neighbor algorithm

Parameters:
vec - vector of initial guesses
Returns:
vector of desision region points

outputDecisionRegion

public void outputDecisionRegion()
Displays the decision regoin on output panel

See Also:
OutputPanel