MachineLearningEvaluateClassifier Task
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 parameters (Set, Get): INPUT_RASTERS, INPUT_MODEL, OUT_REPORT_URI
Output parameters (Get only): OUTPUT_REPORT
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_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.
OUT_REPORT_URI (optional)
Specify the JSON URI containing the report. If not specified, a temporary URI will be used.
Output Parameters
OUTPUT_REPORT
Specify a hash object containing the results written to OUPUT_REPORT_URI.
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 |
Introduced |