This task evaluates a classifier using labeled rasters that may or may not have been used during training. It generates a report containing statistics about the classifiers performance against the input rasters, and provides a confusion matrix of all classes as part of the report.

Example


; Start the application
e = ENVI(/HEADLESS)
 
; Open an ROI file
File = Filepath('qb_boulder_roi.xml', Subdir=['data'], $
Root_Dir=e.Root_Dir)
ROI = ENVI.OpenROI(File)
 
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Specify an output report name
User = GetEnv('USERNAME')
Output_Report = ``
 
; Run statistics normalization
Task_1 = ENVITask('NormalizationStatistics')
Task_1.INPUT_RASTERS = Raster
Task_1.Execute
 
; Run the MLTrainingDataFromROIs task
Task_2 = ENVITask('MLTrainingDataFromROIs')
Task_2.INPUT_RASTER = Raster
Task_2.INPUT_ROI = ROI
Task_2.NORMALIZE_MIN_MAX = Task_1.normalization
Task_2.Execute
 
; Run the TrainRandomForest task
Task_3 = ENVITask('TrainRandomForest')
Task_3.INPUT_RASTERS = Task_2.output_raster
Task_3.Execute
 
; Run the MachineLearningClassification task
Task_4 = ENVITask('MachineLearningClassification')
Task_4.INPUT_RASTER = Raster
Task_4.INPUT_MODEL = Task_3.output_model
Task_4.NORMALIZE_MIN_MAX = Task_1.normalization
Task_4.Execute
 
; Run the task
Task_5 = ENVITask('MachineLearningEvaluateClassifier')
Task_5.INPUT_RASTERS = Task_2.output_raster
Task_5.INPUT_MODEL = Task_3.output_model
Task_5.OUTPUT_REPORT_URI = e.GetTemporaryFilename('.json', /CLEANUP_ON_EXIT)
Task_5.Execute
 
; Output the Machine Learning Evaluate Classifier result
print, Task_5.OUTPUT_REPORT, /IMPLIED_PRINT

Syntax


Result = ENVITask('MachineLearningEvaluateClassifier')

Input properties (Set, Get): INPUT_RASTERS, INPUT_MODEL, OUT_REPORT_URI

Output properties (Get only): OUTPUT_REPORT

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.

Methods


This task inherits the following methods from ENVITask. See the ENVITask topic in ENVI Help.

  • AddParameter
  • Execute
  • Parameter
  • ParameterNames
  • RemoveParameters

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

See the ENVITask topic in ENVI Help for details.

This task also contains the following properties:

INPUT_RASTERS (required)

Specify the single row of spectral rasters that contain pixels for training.

INPUT_MODEL (required)

Specify a trained machine learning model to use for classifying the INPUT_RASTERS.

OUTPUT_REPORT (optional)

Specify a hash object containing the results written to OUPUT_REPORT_URI.

OUT_REPORT_URI (optional)

Specify the JSON URI containing the report. If not specified, a temporary URI will be used.

Version History


Deep Learning 3.0

Introduced

See Also


ENVIMachineLearningModel