Welcome to the Harris Geospatial documentation center. Here you will find reference guides and help documents.


  >  Docs Center  >  ENVI API  >  Classification Framework  >  ENVISoftmaxRegressionClassifier

ENVISoftmaxRegressionClassifier

ENVISoftmaxRegressionClassifier

This function classifies a dataset using a Softmax Regression classifier. See Softmax Regression Background for details on this algorithm.

Use the ENVIGradientDescentTrainer object to train this classifier.

The following diagram shows a typical workflow where the Softmax Regression classifier is used:

 

Example


See Code Example: Softmax Regression Classification Using API Objects.

Syntax


Result = ENVISoftmaxRegressionClassifier([, Keywords=value])

Return Value


This function returns a reference to an ENVISoftmaxRegressionClassifier object.

Arguments


None

Methods


Classify

Dehydrate

GetParameters

GetProperties

Hydrate

Save

Keywords


CLASS_NAMES (optional)

Set this keyword to a string array with the class names.

ERROR (optional)

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

LAMBDA (optional)

Set this keyword to the regularization value used to calculate the loss and gradient when training the classifier. The default value is 0.1.

NATTRIBUTES (required)

Set this keyword to the number of attributes that the input data will be required to have.

NCLASSES (optional)

Set this keyword to the number of unique classes that the classifier will have.

PARAMETERS (optional)

Set this keyword to an IDL dictionary containing the following parameters:

  • Theta: Optional. Specify an array of weights. The array size is k classes by n attributes. This array is used in activation and is updated to calculate the loss and gradient. If you do not set this parameter, default weights will be randomly generated.

Here is an example of a dictionary. In this example, Theta is set to a random initial state, similar to what is done for the default initial weights.

params = Dictionary()
params.Theta = 0.00001RANDOMU(seed, 6, 5)

PROPERTIES (optional)

Set this keyword to an IDL dictionary containing the following properties and parameters:

  • Class_Names: Required. Specify a string array with the class names.
  • NAttributes: Required. Specify the number of attributes that the input data will be required to have.
  • NClasses: Required. Specify the number of unique classes that the classifier will have.
  • Lambda: Optional. Specify the regularization value used to calculate the loss and gradient when training the classifier. The default value is 0.1.

Here is an example of a dictionary:

props = Dictionary()
props.Class_Names = ['Asphalt', 'Concrete', 'Grass', 'Tree', 'Building']
props.NAttributes = 6
props.NClasses = 5
props.Lambda = 100.0

SEED (optional)

If repeatability is desired (such as for testing), specify the seed value used to randomly initialize the weights. This value is ignored if you set the THETA keyword.

THETA (optional)

Set this keyword to an array of weights. The array size is k classes by n attributes. The weights are used in the Softmax Regression activation function, which is used to perform the classification. If you do not set this keyword, default initial weights will be randomly generated. The default initial weights will usually be sufficient.

URI (optional)

Set this keyword to a string with the fully qualified filename and path of the output object. If you specify a URI, the Save method will use that URI. You can restore the object later using ENVIRestoreObject.

Version History


ENVI 5.4

Introduced

API Version


3.3

See Also


ENVICreateSoftmaxRegressionClassifierTask, ENVIExamples, ENVIGradientDescentTrainer, ENVIEvaluateClassifier, ENVIRestoreObject

 



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us