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


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 |
Klasse zur Erkennung des Figurtyps mithilfe des k-NearestNeighbour Verfahrens.
| NearestNeighbour | ( | Dataset | dataset | ) |
Constructor.
| dataset | Set dataset of classified Figures |
| NearestNeighbour | ( | Dataset | dataset, |
| int | kNeighbours | ||
| ) |
Constructor.
| dataset | Set dataset of classified Figures |
| kNeighbours | Amount of selected nearest neighbours |
References NearestNeighbour.kNeighbours.
|
private |
Calc euclidean distance between two Figures.
| actDataPoint | |
| actPointToCompare |
References IDataPoint.getArea(), and IDataPoint.getPerimeter().
Referenced by NearestNeighbour.classify().


| Figure classify | ( | IDataPoint | dataPoint | ) |
Classify new Figure with k- Nearest Neighbour Algorithmn.
| dataPoint | Figure 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().


| void SetKNeighbours | ( | int | kNeighbour | ) |
|
private |
Check amount of Trainingsdata to config k- Parameter.
If no k available, the algorithmn use 50% of trainingsdata (odd figure)
References Dataset.getAllData(), NearestNeighbour.kNeighbours, and Logger.log().
Referenced by NearestNeighbour.classify().


|
private |
|
private |