ExtractMachineLearningModelFromFile Task

This task opens a machine learning model from a file.

Example

; Start the application

e = ENVI(/HEADLESS)

 

; Open an input raster file

File1 = FilePath('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $

SUBDIR=['data'])

Raster = e.OpenRaster(File1)

 

; Open an input ROI file

File2 = FilePath('qb_boulder_roi.xml', ROOT_DIR=e.ROOT_DIR, $

SUBDIR=['data'])

ROI = e.OpenROI(File2)

 

; Get the statistics task from the catalog of ENVITasks

Task1 = ENVITask('NormalizationStatistics')

 

; Define inputs

Task1.INPUT_RASTERS = Raster

Task1.REMOVE_OUTLIERS = 0

 

; Run the task

Task1.Execute

; Get the data prep task from the catalog of ENVITasks

Task2 = ENVITask('MLTrainingDataFromROIs')

 

; Define inputs

Task2.INPUT_RASTER = Raster

Task2.INPUT_ROI = ROI

Task2.BACKGROUND_LABELS = ['Disturbed Earth', 'Water']

Task2.NORMALIZE_MIN_MAX = Task1.Normalization

Task2.Execute

 

; Get the training task from the catalog of ENVITasks

Task3 = ENVITask('TrainRandomForest')

 

; Define inputs

Task3.INPUT_RASTER = Task2.OUTPUT_RASTER

 

; Run the task

Task3.Execute

 

; Get the extract task from the catalog of ENVITasks

Task4 = ENVITask('ExtractMachineLearningModelFromFile')

 

; Define inputs

Task4.INPUT_URI = Task3.OUTPUT_MODEL_URI

 

; Run the task

Task4.Execute

 

; Get the model and display attributes

outputModel = Task4.OUTPUT_MODEL

print, outputModel.Attributes, /IMPLIED_PRINT

Syntax

Result = ENVITask('ExtractMachineLearningModelFromFile')

Input parameters (Set, Get): INPUT_URI

Output parameters (Get only): OUTPUT_MODEL

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

Input Parameters

INPUT_URI (required)

Specify the machine learning model file to be used.

Output Parameters

OUTPUT_MODEL

This is the machine learning model extracted from the file.

Methods

Execute

Parameter

ParameterNames

See ENVI Help for details on these ENVITask methods.

Properties

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

See the ENVITask topic in ENVI Help for details.

Version History

Machine Learning 3.0.1

Introduced

See Also

ENVIMachineLearningModel