Confusion matrix / Matching matrix
by Avinash Uppuluri
25 Aug 2008
(Updated 23 Sep 2008)
CFMATRIX calculates the confusion matrix for any classification algorithm that generates a list of c
|
Watch this File
|
| File Information |
| Description |
function [confmatrix] = cfmatrix(actual, predict, classlist, per)
% Outputs: confusion matrix
%
%
% Inputs:
% 1. actual / 2. predict
% The inputs provided are the 'actual' classes vector and the 'predict'ed classes vector. The actual classes are the classes to which the input feature vectors belong. The predicted classes are the class to which the input feature vectors are predicted to belong to, based on a prediction algorithm.
% The length of actual class vector and the predicted class vector need to be the same. If they are not the same, an error message is displayed.
% 3. classlist
% The third input provides the list of all the classes {p,n,...} for which the classification is being done. All classes are numbers.
% 4. per = 1/0 (default = 0)
% This parameter when set to 1 provides the values in the confusion matrix as percentages. The default provides the values in numbers.
%
% Example:
% >> a = [ 1 2 3 1 2 3 1 1 2 3 2 1 1 2 3];
% >> b = [ 1 2 3 1 2 3 1 1 1 2 2 1 2 1 3];
% >> Cf = cfmatrix(a, b); |
| MATLAB release |
MATLAB 7.0.1 (R14SP1)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 23 Sep 2008 |
Improve description |
|
Contact us at files@mathworks.com