This function restores an ENVIMachineLearningModel object, which specifies the MachineLearning model used for machine learning.

Example


; Start the application
e = ENVI(/HEADLESS)
 
; Create a model object
Model = ENVIMachineLearningModel('model_file.json', ERROR=error)
 
; Display some model information
print, 'Number of Bands: ', Strtrim(Model.nBands, 2)
print, 'Numer of Classes: ', Strtrim(Model.nClasses, 2)
print, 'Class Labels: ', Model.Labels
ModelStats = Model.Statistics
print, ModelStats, /IMPLIED
 
end

Syntax


Result = ENVIMachineLearningModel(Input_File [, Properties=value] [, ERROR=value])

Return Value


This routine returns a reference to an ENVIMachineLearningModel object.

Arguments


Input_File

Specify a fully qualified filename and path to an ENVIMachineLearningModel file in HDF5 format.

Methods


Close

Dehydrate

Hydrate

Properties


Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

COLORS (Get)

An array of RGB triplets, one per label.

DESCRIPTION (Get)

A description of the model's capabilities.

LABELS (Get)

An array of string labels, one per class.

MODEL_TYPE (Get)

The string reference for the model type.

NAME (Get)

The name of the model.

NBANDS (Get)

The number of bands in the training rasters (minus the mask band).

NCLASSES (Get)

The number of classes (minus the background class).

SCALE_FACTOR (Get)

A user-defined scale factor for normalizing the data.

SCHEMA (Get)

The schema reference.

STATISTICS (Get)

OrderedHash providing per-class metrics, global metrics, and a confusion matrix.

URI (Get)

A string that is a fully-qualified raster file path.

Keywords


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 the Manage Errors topic in ENVI Help for more information on error handling.

Version History


Deep Learning 2.0

Introduced

See Also


MachineLearningClassification Task