Tool Random Forest Classification
Integration of the OpenCV Machine Learning library for Random Forest classification of gridded features.
References
- OpenCV - Open Source Computer Vision
- OpenCV - Machine Learning Overview
- Breiman, L. (2001): Random Forests. Machine Learning, 45 (1): 5-32. doi:10.1023/A:1010933404324.
- 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. | - | |
Maximum Tree Depth | integer number | MAX_DEPTH | The maximum possible depth of the tree. That is the training algorithms attempts to split a node while its depth is less than maxDepth. The root node has zero depth. | Minimum: 1 Default: 10 | |
Minimum Sample Count | integer number | MIN_SAMPLES | If the number of samples in a node is less than this parameter then the node will not be split. | Minimum: 2 Default: 2 | |
Maximum Categories | integer number | MAX_CATEGRS | Cluster possible values of a categorical variable into K<=maxCategories clusters to find a suboptimal split. | Minimum: 1 Default: 10 | |
Use 1SE Rule | boolean | 1SE_RULE | If true then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate. | Default: 1 | |
Truncate Pruned Trees | boolean | TRUNC_PRUNED | If true then pruned branches are physically removed from the tree. Otherwise they are retained and it is possible to get results from the original unpruned (or pruned less aggressively) tree. | Default: 1 | |
Regression Accuracy | floating point number | REG_ACCURACY | Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split further. | Minimum: 0.000000 Default: 0.010000 | |
Active Variable Count | integer number | ACTIVE_VARS | The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features. | Minimum: 0 Default: 0 | |
(*) optional |
Command-line
Usage: saga_cmd imagery_opencv 10 [-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>] [-MAX_DEPTH <num>] [-MIN_SAMPLES <num>] [-MAX_CATEGRS <num>] [-1SE_RULE <str>] [-TRUNC_PRUNED <str>] [-REG_ACCURACY <double>] [-ACTIVE_VARS <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 -MAX_DEPTH:<num> Maximum Tree Depth integer number Minimum: 1 Default: 10 -MIN_SAMPLES:<num> Minimum Sample Count integer number Minimum: 2 Default: 2 -MAX_CATEGRS:<num> Maximum Categories integer number Minimum: 1 Default: 10 -1SE_RULE:<str> Use 1SE Rule boolean Default: 1 -TRUNC_PRUNED:<str> Truncate Pruned Trees boolean Default: 1 -REG_ACCURACY:<double> Regression Accuracy floating point number Minimum: 0.000000 Default: 0.010000 -ACTIVE_VARS:<num> Active Variable Count integer number Minimum: 0 Default: 0