> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ConfusionMatrix Object (IConfusionMatrix Interface)

This object represents the confusion matrix for a classification model. The confusion matrix is a square table in which each cell contains the number of objects classified into category \<column-name> while belonging to category \<row-name>. The diagonal cells will contain the number of correctly assigned elements for each category.

The matrix size is the number of categories plus one, with the last column showing the number of objects in each category for which classification failed.

<img src="https://mintcdn.com/abbyy/i-EfCQVmseNiPQcp/images/fine-reader/engine/pict_confusionmatrix.gif?s=7e6ca807e595aeaea9ebad43ba37deeb" alt="pict_ConfusionMatrix" width="301" height="301" data-path="images/fine-reader/engine/pict_confusionmatrix.gif" />

## Properties

| Name                                                                                                         | Type                                                                                                                                                                                                                                         | Description                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AxisLabels                                                                                                   | [StringsCollection](/fine-reader/engine/api-reference/supplementary-objects-and-methods/stringscollection), [read-only](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties#readonly_properties) | The names of the categories in the order in which they appear. The rows correspond to the actual category, the columns — to the category predicted by the classification model. |
| [Element](/fine-reader/engine/api-reference/classification-related-objects/confusionmatrix/element-property) | [int](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties), read-only                                                                                                                            | Returns the element in the selected cell.                                                                                                                                       |
| Size                                                                                                         | [int](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties), read-only                                                                                                                            | The number of rows in the confusion matrix. It is equal to the number of categories plus 1: the extra column corresponds to the objects which the model was unable to classify. |

## Related objects

<img src="https://mintcdn.com/abbyy/6udH-pkk8zkVafYH/images/fine-reader/engine/confusionmatrix.gif?s=bbca5a851ef0cae82dac292619d85d02" alt="ConfusionMatrix" width="191" height="118" data-path="images/fine-reader/engine/confusionmatrix.gif" />[](/fine-reader/engine/api-reference/classification-related-objects/validationresult)[](/fine-reader/engine/api-reference/classification-related-objects/trainingresult#validationresult)[](/fine-reader/engine/api-reference/classification-related-objects/trainingresult)[](/fine-reader/engine/api-reference/supplementary-objects-and-methods/stringscollection)

[Object Diagram](/fine-reader/engine/api-reference/object-diagram)

## Samples

This object is used in the [Classification](/fine-reader/engine/guided-tour/samples#classification) demo tool in Windows and the [Classification](/fine-reader/engine/guided-tour/samples#classification_unix) code sample in Linux and macOS.
