Tool K-Nearest Neighbours Classification
Integration of the OpenCV Machine Learning library for K-Nearest Neighbours classification of gridded features.
References
- Author: O.Conrad (c) 2016
- Menu: Imagery|Classification|Machine Learning
Parameters
Name | Type | Identifier | Description | Constraints | |
---|---|---|---|---|---|
Input | Features | grid list, input | FEATURES | - | - |
Training Samples | table, input | TRAIN_SAMPLES | Provide a class identifier in the first field followed by sample data corresponding to the input feature grids. | - | |
Training Areas | shapes, input | TRAIN_AREAS | - | - | |
Output | Classification | grid, output | CLASSES | - | - |
Look-up Table (*) | table, output, optional | CLASSES_LUT | A reference list of the grid values that have been assigned to the training classes. | - | |
Options | Normalize | boolean | NORMALIZE | - | Default: 0 |
Colors from Features | boolean, GUI | RGB_COLORS | Use the first three features in list to obtain blue, green, red components for class colour in look-up table. | Default: 0 | |
Grid System | grid system | GRID_SYSTEM | - | - | |
Training | choice | MODEL_TRAIN | - | Available Choices: [0] training areas [1] training samples [2] load from file Default: 0 | |
Class Identifier | table field | TRAIN_CLASS | - | - | |
Buffer Size | floating point number | TRAIN_BUFFER | For non-polygon type training areas, creates a buffer with a diameter of specified size. | Minimum: 0.000000 Default: 1.000000 | |
Load Model | file path | MODEL_LOAD | Use a model previously stored to file. | - | |
Save Model | file path | MODEL_SAVE | Stores model to file to be used for subsequent classifications instead of training areas. | - | |
Default Number of Neighbours | integer number | NEIGHBOURS | - | Minimum: 1 Default: 3 | |
Training Method | choice | TRAINING | - | Available Choices: [0] classification [1] regression model Default: 0 | |
Algorithm Type | choice | ALGORITHM | - | Available Choices: [0] brute force [1] KD Tree Default: 0 | |
Parameter for KD Tree implementation | integer number | EMAX | - | Minimum: 1 Default: 1000 | |
(*) optional |
Command-line
Usage: saga_cmd imagery_opencv 6 [-FEATURES <str>] [-NORMALIZE <str>] [-CLASSES <str>] [-CLASSES_LUT <str>] [-MODEL_TRAIN <str>] [-TRAIN_SAMPLES <str>] [-TRAIN_AREAS <str>] [-TRAIN_CLASS <str>] [-TRAIN_BUFFER <double>] [-MODEL_LOAD <str>] [-MODEL_SAVE <str>] [-NEIGHBOURS <num>] [-TRAINING <str>] [-ALGORITHM <str>] [-EMAX <num>] -FEATURES:<str> Features grid list, input -NORMALIZE:<str> Normalize boolean Default: 0 -CLASSES:<str> Classification grid, output -CLASSES_LUT:<str> Look-up Table table, output, optional -MODEL_TRAIN:<str> Training choice Available Choices: [0] training areas [1] training samples [2] load from file Default: 0 -TRAIN_SAMPLES:<str> Training Samples table, input -TRAIN_AREAS:<str> Training Areas shapes, input -TRAIN_CLASS:<str> Class Identifier table field -TRAIN_BUFFER:<double> Buffer Size floating point number Minimum: 0.000000 Default: 1.000000 -MODEL_LOAD:<str> Load Model file path -MODEL_SAVE:<str> Save Model file path -NEIGHBOURS:<num> Default Number of Neighbours integer number Minimum: 1 Default: 3 -TRAINING:<str> Training Method choice Available Choices: [0] classification [1] regression model Default: 0 -ALGORITHM:<str> Algorithm Type choice Available Choices: [0] brute force [1] KD Tree Default: 0 -EMAX:<num> Parameter for KD Tree implementation integer number Minimum: 1 Default: 1000