Class DataPoints

java.lang.Object
  extended by DataPoints

public class DataPoints
extends java.lang.Object

class holds the input DataPoints classes that are to be classified as well as the classification algorithms needed to compute the decision regions


Method Summary
 void addPoint(MyPoint p)
          add a point to the data set that is determined by the index (setNum)
 void clearAllSets()
          clear out all point form the data sets
static java.awt.Point convertMyPoint(MyPoint dpoint, int panelWidth, int panelHeight, DisplayScale scale)
          Converts an instance of MyPoint to an instance of Point
static java.util.Vector<java.awt.Point> convertMyPoints(java.util.Vector<MyPoint> dset, int panelWidth, int panelHeight, DisplayScale scale)
          Converts a Vector of MyPoints to a Vector of points that correspond to Java coordinates.
static MyPoint convertPoint(java.awt.Point jpoint, int panelWidth, int panelHeight, DisplayScale scale)
          Converts an instance of Point to an instance of MyPoint containing the cartesian x-y values
static java.util.Vector<MyPoint> convertPoints(java.util.Vector<java.awt.Point> jset, int panelWidth, int panelHeight, DisplayScale scale)
          Converts a vector of Points to a vector of MyPoints containing the cartesian x-y values
 void drawGaussian(double meanx, double meany, DisplayScale scale)
          Draws Gaussian distribution by calling setGaussian()
 boolean initialize()
          initializes dset1-dset4
 boolean isDataValid()
          method returns true if valid data is present else it returns false
 void setColors(java.awt.Color color_dset1, java.awt.Color color_dset2, java.awt.Color color_dset3, java.awt.Color color_dset4)
          sets the gaussian values
 void setDrawGaussValues(int points, double cov11, double cov12, double cov21, double cov22)
          sets the gaussian values
 void setFourEllipses(DisplayScale scale)
          create a set of point that correspond to four ellipses to be displayed on the input canvas
 void setFourGaussian(DisplayScale scale)
          create a set of point that correspond to four gaussians to be displayed on the input canvas method: setFourGaussian
 void setGaussian(int points, double meanx, double meany, double c11, double c12, double c21, double c22, DisplayScale scale)
          creates a set of point that correspond to a gaussians distribution
 void setLorentzSignal(DisplayScale scale)
          Draws a Lorentz generated signal.
 void setOverGaussian(DisplayScale scale)
          create a set of point that correspond to two overlapped gaussians to be displayed on the input canvas
 void setRandomSignal(DisplayScale scale)
          Draws a randomly generated signal.
 void setRotatedEllipses(DisplayScale scale)
          create a set of point that correspond to two rotated ellipses to be displayed on the input canvas
 void setToroidal(DisplayScale scale)
          create a set of point that correspond a toroidal to be displayed on the input canvas
 void setTwoEllipses(DisplayScale scale)
          create a set of point that correspond to two ellipses to be displayed on the input canvas
 void setTwoGaussian(DisplayScale scale)
          create a set of point that correspond to two gaussians to be displayed on the input canvas
 void setYinYang(DisplayScale scale)
          create a set of point that correspond a yin and yang symbol to be displayed on the input canvas
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public boolean initialize()
initializes dset1-dset4

Returns:
true

isDataValid

public boolean isDataValid()
method returns true if valid data is present else it returns false

Returns:
true if data is valid

clearAllSets

public void clearAllSets()
clear out all point form the data sets


addPoint

public void addPoint(MyPoint p)
add a point to the data set that is determined by the index (setNum)

Parameters:
p - point to be added to the input data class

drawGaussian

public void drawGaussian(double meanx,
                         double meany,
                         DisplayScale scale)
Draws Gaussian distribution by calling setGaussian()

Parameters:
meanx - double x value of mean point
meany - double y value of mean point
scale - DisplayScale variable used for displaying

setGaussian

public void setGaussian(int points,
                        double meanx,
                        double meany,
                        double c11,
                        double c12,
                        double c21,
                        double c22,
                        DisplayScale scale)
creates a set of point that correspond to a gaussians distribution

Parameters:
points - max points in the distribution
meanx - mean (x) of the distribution
meany - mean (y) of the distribution
c11 - covariance matrix element c11
c12 - covariance matrix element c12
c21 - covariance matrix element c21
c22 - covariance matrix element c22
scale - DisplayScale variable

setTwoGaussian

public void setTwoGaussian(DisplayScale scale)
create a set of point that correspond to two gaussians to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for displaying

setFourGaussian

public void setFourGaussian(DisplayScale scale)
create a set of point that correspond to four gaussians to be displayed on the input canvas method: setFourGaussian

Parameters:
scale - DisplayScale variable used for displaying

setOverGaussian

public void setOverGaussian(DisplayScale scale)
create a set of point that correspond to two overlapped gaussians to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for displaying

setTwoEllipses

public void setTwoEllipses(DisplayScale scale)
create a set of point that correspond to two ellipses to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for displaying

setRotatedEllipses

public void setRotatedEllipses(DisplayScale scale)
create a set of point that correspond to two rotated ellipses to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for displaying

setFourEllipses

public void setFourEllipses(DisplayScale scale)
create a set of point that correspond to four ellipses to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for displaying

setToroidal

public void setToroidal(DisplayScale scale)
create a set of point that correspond a toroidal to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for displaying

setYinYang

public void setYinYang(DisplayScale scale)
create a set of point that correspond a yin and yang symbol to be displayed on the input canvas

Parameters:
scale - DisplayScale variable used for viewing

setRandomSignal

public void setRandomSignal(DisplayScale scale)
Draws a randomly generated signal. It follows a sine curve with gaussian noise

Parameters:
scale - DisplayScale variable used for viewing

setLorentzSignal

public void setLorentzSignal(DisplayScale scale)
Draws a Lorentz generated signal. It follows a sine curve with gaussian noise

Parameters:
scale - DisplayScale variable used for viewing

convertPoint

public static MyPoint convertPoint(java.awt.Point jpoint,
                                   int panelWidth,
                                   int panelHeight,
                                   DisplayScale scale)
Converts an instance of Point to an instance of MyPoint containing the cartesian x-y values

Parameters:
jpoint - Point variable used to set MyPoint
panelWidth - Width of viewing panel
panelHeight - Height of viewing panel
scale - DisplayScale variable used for viewing
Returns:
MyPoint convertion

convertPoints

public static java.util.Vector<MyPoint> convertPoints(java.util.Vector<java.awt.Point> jset,
                                                      int panelWidth,
                                                      int panelHeight,
                                                      DisplayScale scale)
Converts a vector of Points to a vector of MyPoints containing the cartesian x-y values

Parameters:
jset - Vector of points to be converted
panelWidth - Width of viewing panel
panelHeight - Height of viewing panel
Returns:
Vector of MyPoints converted

convertMyPoint

public static java.awt.Point convertMyPoint(MyPoint dpoint,
                                            int panelWidth,
                                            int panelHeight,
                                            DisplayScale scale)
Converts an instance of MyPoint to an instance of Point

Parameters:
dpoint - MyPoint to be converted
panelWidth - Width of panel for viewing
panelHeight - Width of panel for viewing
Returns:
Point type converted from MyPoint type

convertMyPoints

public static java.util.Vector<java.awt.Point> convertMyPoints(java.util.Vector<MyPoint> dset,
                                                               int panelWidth,
                                                               int panelHeight,
                                                               DisplayScale scale)
Converts a Vector of MyPoints to a Vector of points that correspond to Java coordinates.

Parameters:
dset - Vector of MyPoints to be converted to Vector of Points
panelWidth - Width of panel for viewing
panelHeight - Height of panel for viewing
Returns:
Vector of Points converted from MyPoints

setDrawGaussValues

public void setDrawGaussValues(int points,
                               double cov11,
                               double cov12,
                               double cov21,
                               double cov22)
sets the gaussian values

Parameters:
points - number of points
cov11 - double value of covariance11
cov12 - double value of covariance12
cov21 - double value of covariance21
cov22 - double value of covariance22

setColors

public void setColors(java.awt.Color color_dset1,
                      java.awt.Color color_dset2,
                      java.awt.Color color_dset3,
                      java.awt.Color color_dset4)
sets the gaussian values

Parameters:
color_dset1 - color for data set 1
color_dset2 - color for data set 2
color_dset3 - color for data set 3
color_dset4 - color for data set 4