# confmat

## Purpose

Compute a confusion matrix.

## Synopsis

    [C, rate] = confmat(y, t)

## Description

`[C, rate] = confmat(y, t)` computes the confusion matrix `C` and classification performance `rate` for the predictions mat{y} compared with the targets `t`. The data is assumed to be in a 1-of-N encoding, unless there is just one column, when it is assumed to be a 2 class problem with a 0-1 encoding. Each row of `y` and `t` corresponds to a single example.

In the confusion matrix, the rows represent the true classes and the columns the predicted classes. The vector `rate` has two entries: the percentage of correct classifications and the total number of correct classifications.

## See Also

`conffig`, `demtrain`

Pages: Index

Copyright (c) Ian T Nabney (1996-9)