ENVIConfusionMatrix::ConfusionMatrix
The ConfusionMatrix function method returns the actual confusion matrix computed from the input truth values and predicted values.
In an ENVI confusion matrix, columns represent true classes, while rows represent the classifier's predictions. The matrix is square, with all correct classifications along the upper-left to lower-right diagonal.
Here are some examples of how to read this matrix:
- 2,385 values were correctly classified as Asphalt.
- Reading down the Concrete column, 4 values that should have been Concrete were classified as Asphalt, and 1 value was classified as Grass. These are omission errors, which are defined as the fraction of values that belong to a class but were predicted to be in a different class. Errors of omission represent false negatives.
- Reading across the Concrete row, 1 value that should have been Building was classified as Concrete. This is a commission error, which is defined as the fraction of values that were predicted to be in a class but do not belong to that class. Errors of commission represent false positives.
Here is an example of how IDL prints the confusion matrix from the SVM classifier:
12247
|
20
|
0
|
3
|
35
|
0
|
1653
|
2
|
0
|
7
|
6
|
3
|
4469
|
37
|
0
|
1
|
0
|
0
|
5472
|
30
|
73
|
1
|
0
|
13
|
9968
|
Example
See the following topics for code examples:
Syntax
Result = ENVIConfusionMatrix.ConfusionMatrix([, 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