ENVIConfusionMatrix::F1
The F1 function method returns the F1 score, which is the harmonic mean of the User Accuracy and Producer Accuracy values:
The result is an array with one value per class.
In the confusion matrix below, the F1 value is calculated as follows:
Asphalt: 0.995617
Concrete: 0.991045
Grass: 0.995068
Tree: 0.989051
Building: 0.992267
Example
See the following topics for code examples:
Return Value
This function method returns the F1 score from a confusion matrix.
Syntax
Result = ENVIConfusionMatrix.F1([, ERROR=variable])
Arguments
None
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 Manage Errors for more information on error handling in ENVI programming.
Version History
API Version
3.3
See Also
ENVIConfusionMatrix