URI: http://www.qualityml.org/1.0/metrics/ConfusionMatrix
Name: Confusion matrix
Alternative names: Misclassification matrix
Definition:

Matrix that indicates the number of items of class (i; the truth) classified as class (j; predicted).

The confusion matrix is a NxN matrix with N columns and N rows. N denotes the number of classes under consideration.
MCM (i,j) = ( # items of class (i) classified as class (j) )
The diagonal elements of the confusion matrix contain the correctly classified items, and the off diagonal elements contain the number of misclassification errors.

Parameters: Extends http://www.uncertml.org/metrics/confusion-matrix adding a max value
Source: ISO 19157
Categories: Thematic accuracy
Further information: http://en.wikipedia.org/wiki/Confusion_matrix
XML schema:
<schema xmlns:qml="http://www.qualityml.org/1.0" 
xmlns:un="http://www.uncertml.org/2.0" 
xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.qualityml.org/1.0" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
<import namespace="http://www.uncertml.org/2.0" schemaLocation="../../uncertml/2.0/uncertml.xsd"/>

<element name="ConfusionMatrix" type="qml:ConfusionMatrixType" substitutionGroup="un:AbstractSummaryStatistic"/>
<complexType name="ConfusionMatrixType">
<complexContent>
<extension base="un:AbstractSummaryStatisticType">
<sequence>
<element name="actualCategories" type="un:CategoricalValuesType"/>
<element name="predictedCategories" type="un:CategoricalValuesType"/>
<element name="values" type="un:ContinuousValuesType"/>
</sequence>
<attribute name="max" type="qml:nonNegativeRealNumber"/>
</extension>
</complexContent>
</complexType>

XML example:
<un:StatisticsCollection xmlns:qml="http://www.qualityml.org/1.0" 

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

   xsi:schemaLocation="http://www.qualitymlorg/schemas/qualityml/1.0/qualityml.xsd">

<qml:ConfusionMatrix max="100">
<qml:actualCategories>A B C</qml:actualCategories>
<qml:predictedCategories>A B C</qml:predictedCategories>
<qml:values> 87 1 12 5 88 7 8 11 81 </qml:values>
</qml:ConfusionMatrix>

JSON example:
N/A
API example:
N/A
Value constraints: categories: any string
counts: any positive natural number