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

      class = "KNN_Pick"
      name = "KNN_PICK"


classThe class name for the module; must be "KNN_Pick".string
nameThe name of this instance of the module.string
categoricalCategorical 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.booltrue
weighedIf 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).boolfalse
weight_divisorThis 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)float1.0

Module Connections


OUTPUT_TABLEThe outputs (classes) of the elements (neighbors).
DISTANCE_TABLEThe distances of the elements (neighbors).


CLASS_OUTPUTThe calculated class.


Alexander Kolodziej



blog comments powered by Disqus