Welcome to the L3 Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿
>  Docs Center  >  ENVI API  >  Classification Framework  >  ENVIIterativeTrainer

### ENVIIterativeTrainer

ENVIIterativeTrainer

This function uses an iterative loop to train a classifier that knows how to update its own weights; for example, Support Vector Machine (SVM). The trainer iteraties until the classifier's change in loss falls below a specified convergence criterion or it reaches a specified maximum number of iterations. The convergence criterion and maximum iterations needed to effectively train a classifier (not just each classifier type, but each classifier instance) can vary considerably. They often take some experimentation to determine.

The following diagram shows a typical workflow where the iterative trainer is used:

## Example

See the following topics for code examples:

## Syntax

Result = ENVIIterativeTrainer([, Keywords=value])

## Return Value

This function returns a reference to an ENVIIterativeTrainer object.

## Keywords

### CONVERGENCE_CRITERION (optional)

Set this keyword to a convergence criterion. Ideally, with each iteration, the change in loss value decreases until it meets a specified threshold, below which iterations can stop. This threshold is the convergence criterion. If you do not set this keyword, the default value is 0.001.

### MAXIMUM_ITERATIONS (optional)

Set this keyword to the maximum number of iterations to perform if the convergence criterion is not met. If you do not set this keyword, the default value is 100.

### PROPERTIES

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

• Convergence_Criterion: Required. Ideally, with each iteration, the change in loss value decreases until it meets a specified threshold, below which iterations can stop. This threshold is the convergence criterion. A suggested starting value is 0.0001.
• Maximum_Iterations: Required. Specify the maximum number of iterations to perform if the convergence criterion is not met. A suggested starting value is 100.

Here is an example of a dictionary:

`Properties = Dictionary()`
`Properties.Convergence_Criterion = 0.001`
`Properties.Maximum_Iterations = 100`

### 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.

### 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

3.3