LegoAgent-Eve
NearestNeighbour Class Reference

Klasse zur Erkennung des Figurtyps mithilfe des k-NearestNeighbour Verfahrens. More...

Inheritance diagram for NearestNeighbour:
Collaboration diagram for NearestNeighbour:

Public Member Functions

 NearestNeighbour (Dataset dataset)
 Constructor. More...
 
 NearestNeighbour (Dataset dataset, int kNeighbours)
 Constructor. More...
 
void SetKNeighbours (int kNeighbour)
 Set amount of selected nearest neighbour. More...
 
Figure classify (IDataPoint dataPoint)
 Classify new Figure with k- Nearest Neighbour Algorithmn. More...
 

Private Member Functions

double calcEuklidDistance (IDataPoint actDataPoint, IDataPoint actPointToCompare)
 Calc euclidean distance between two Figures. More...
 
boolean validateAmountOfTrainingData ()
 Check amount of Trainingsdata to config k- Parameter. More...
 

Private Attributes

Dataset dataSet
 
int kNeighbours = 0
 

Detailed Description

Klasse zur Erkennung des Figurtyps mithilfe des k-NearestNeighbour Verfahrens.

Constructor & Destructor Documentation

NearestNeighbour ( Dataset  dataset)

Constructor.

Parameters
datasetSet dataset of classified Figures
NearestNeighbour ( Dataset  dataset,
int  kNeighbours 
)

Constructor.

Parameters
datasetSet dataset of classified Figures
kNeighboursAmount of selected nearest neighbours

References NearestNeighbour.kNeighbours.

Member Function Documentation

double calcEuklidDistance ( IDataPoint  actDataPoint,
IDataPoint  actPointToCompare 
)
private

Calc euclidean distance between two Figures.

Parameters
actDataPoint
actPointToCompare
Returns
euclidean Distance between this Figures

References IDataPoint.getArea(), and IDataPoint.getPerimeter().

Referenced by NearestNeighbour.classify().

Here is the call graph for this function:

Here is the caller graph for this function:

Figure classify ( IDataPoint  dataPoint)

Classify new Figure with k- Nearest Neighbour Algorithmn.

Parameters
dataPointFigure to classify

Implements INearestNeighbour.

References NearestNeighbour.calcEuklidDistance(), Figure.circle, Dataset.getAllData(), NearestNeighbour.kNeighbours, Logger.log(), Figure.rectangle, IDataPoint.setFigure(), Figure.UNKNOWN, and NearestNeighbour.validateAmountOfTrainingData().

Referenced by Recognition.recognizeKNN().

Here is the call graph for this function:

Here is the caller graph for this function:

void SetKNeighbours ( int  kNeighbour)

Set amount of selected nearest neighbour.

Parameters

Implements INearestNeighbour.

boolean validateAmountOfTrainingData ( )
private

Check amount of Trainingsdata to config k- Parameter.

If no k available, the algorithmn use 50% of trainingsdata (odd figure)

Returns

References Dataset.getAllData(), NearestNeighbour.kNeighbours, and Logger.log().

Referenced by NearestNeighbour.classify().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Dataset dataSet
private

The documentation for this class was generated from the following file: