KNN_Pick
This module chooses a class based on some input elements (neighbors). It can deal with categorical classes (then the amount of instances of the classes decides), and with qualitative classes (then the mean is calculated). The amount of instances and the mean can be weighed. If this is the case, then instances will be counted more (or less) times, depending on their distance. This module can be connected to the KNN module (KNN.OUTPUT_TABLE to KNN_PICK.OUTPUT_TABLE and KNN.DISTANCE_TABLE to KNN_PICK.DISTANCE_TABLE. Note: KNN.INPUT_TABLE is not used by this module. This module is too simple to look at individual elements coordinates.).
Example XML definition
A simple example
<module class = "KNN_Pick" name = "KNN_PICK" />
Parameters
Name | Description | Type | Default |
---|---|---|---|
class | The class name for the module; must be "KNN_Pick". | string | |
name | The name of this instance of the module. | string | |
categorical | Categorical means that the classes of the elements are discrete. E.g. {1,2,3}. If 'categorical' is set to false it means the values are qualitative, i.e. probably each element has a class of its own (or rather, there are no discrete classes). For categorical classes the amount of each class is counted, for qualitative classes a mean is calculated. The result can be weighed in both cases. | bool | true |
weighed | If this is set to true the elements with smaller distances are more valuable for the result. If you want to edit exactly how this is calculated, look at the function GetWeightFactor(distance). | bool | false |
weight_divisor | This is the divisor in the division when the weight factor is calculated. The distance is part of the divider. If you want to edit exactly how this is calculated, look at the function GetWeightFactor(distance) | float | 1.0 |
Module Connections
Inputs
Name | Description |
---|---|
OUTPUT_TABLE | The outputs (classes) of the elements (neighbors). |
DISTANCE_TABLE | The distances of the elements (neighbors). |
Outputs
Name | Description |
---|---|
CLASS_OUTPUT | The calculated class. |
Author
Alexander Kolodziej
alexander.kolodziej@gmail.com
LUCS
Files
KNN_Pick.h
KNN_Pick.cc
KNN_Pick.ikc