SAGA-GIS Tool Library Documentation (v9.0.1)

Tool Logistic Regression (OpenCV)

Integration of the OpenCV Machine Learning library for Logistic Regression based classification of gridded features.

Optimization algorithms like Batch Gradient Descent and Mini-Batch Gradient Descent are supported in Logistic Regression. It is important that we mention the number of iterations these optimization algorithms have to run. The number of iterations can be thought as number of steps taken and learning rate specifies if it is a long step or a short step. This and previous parameter define how fast we arrive at a possible solution.

In order to compensate for overfitting regularization can be performed. (L1 or L2 norm).

Logistic regression implementation provides a choice of two training methods with Batch Gradient Descent or the Mini-Batch Gradient Descent.


References


Parameters

 NameTypeIdentifierDescriptionConstraints
InputFeaturesGrid list, inputFEATURES--
Training AreasShapes, inputTRAIN_AREAS--
OutputClassificationGrid, outputCLASSES--
Look-up Table (*)Table, output, optionalCLASSES_LUTA reference list of the grid values that have been assigned to the training classes.-
OptionsGrid SystemGrid systemPARAMETERS_GRID_SYSTEM--
NormalizeBooleanNORMALIZE-Default: 0
Update Colors from FeaturesBoolean, GUIRGB_COLORSUse the first three features in list to obtain blue, green, red components for class colour in look-up table.Default: 0
Load ModelFile pathMODEL_LOADUse a model previously stored to file.-
Class IdentifierTable fieldTRAIN_CLASS--
Buffer SizeFloating pointTRAIN_BUFFERFor non-polygon type training areas, creates a buffer with a diameter of specified size.Minimum: 0.000000
Default: 1.000000
Save ModelFile pathMODEL_SAVEStores model to file to be used for subsequent classifications instead of training areas.-
Learning RateFloating pointLOGR_LEARNING_RATEThe learning rate determines how fast we approach the solution.Minimum: 0.000000
Default: 1.000000
Number of IterationsIntegerLOGR_ITERATIONS-Minimum: 1
Default: 300
RegularizationChoiceLOGR_REGULARIZATION-Available Choices:
[0] disabled
[1] L1 norm
[2] L2 norm
Default: 0
Training MethodChoiceLOGR_TRAIN_METHOD-Available Choices:
[0] Batch Gradient Descent
[1] Mini-Batch Gradient Descent
Default: 0
Mini-Batch SizeIntegerLOGR_MINIBATCH_SIZE-Minimum: 1
Default: 1
(*) optional

Command-line

Usage: saga_cmd imagery_opencv 12 [-FEATURES <str>] [-NORMALIZE <str>] [-CLASSES <str>] [-CLASSES_LUT <str>] [-MODEL_LOAD <str>] [-TRAIN_AREAS <str>] [-TRAIN_CLASS <str>] [-TRAIN_BUFFER <double>] [-MODEL_SAVE <str>] [-LOGR_LEARNING_RATE <double>] [-LOGR_ITERATIONS <num>] [-LOGR_REGULARIZATION <str>] [-LOGR_TRAIN_METHOD <str>] [-LOGR_MINIBATCH_SIZE <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_LOAD:<str>           	Load Model
	File path
  -TRAIN_AREAS:<str>          	Training Areas
	Shapes, input
  -TRAIN_CLASS:<str>          	Class Identifier
	Table field
  -TRAIN_BUFFER:<double>      	Buffer Size
	Floating point
	Minimum: 0.000000
	Default: 1.000000
  -MODEL_SAVE:<str>           	Save Model
	File path
  -LOGR_LEARNING_RATE:<double>	Learning Rate
	Floating point
	Minimum: 0.000000
	Default: 1.000000
  -LOGR_ITERATIONS:<num>      	Number of Iterations
	Integer
	Minimum: 1
	Default: 300
  -LOGR_REGULARIZATION:<str>  	Regularization
	Choice
	Available Choices:
	[0] disabled
	[1] L1 norm
	[2] L2 norm
	Default: 0
  -LOGR_TRAIN_METHOD:<str>    	Training Method
	Choice
	Available Choices:
	[0] Batch Gradient Descent
	[1] Mini-Batch Gradient Descent
	Default: 0
  -LOGR_MINIBATCH_SIZE:<num>  	Mini-Batch Size
	Integer
	Minimum: 1
	Default: 1