Code covered by the BSD License  

Highlights from
Computing the posterior balanced accuracy

image thumbnail

Computing the posterior balanced accuracy

by

 

A set of MATLAB functions for evaluating generalization performance in binary classification.

acc_ppi(C,alpha)
% Posterior probability interval of the accuracy.
% 
% Usage:
%     [a_lower,a_upper] = acc_ppi(C,alpha)
% 
% Arguments:
%     C - 2x2 confusion matrix of classification outcomes
%     alpha - The posterior probability interval will cover 1-alpha of
%         probability mass such that (1-alpha)/2 remains on either end of
%         the distribution.

% Kay H. Brodersen, ETH Zurich, Switzerland
% http://people.inf.ethz.ch/bkay/
% $Id: acc_ppi.m 8245 2010-10-22 12:57:51Z bkay $
% -------------------------------------------------------------------------
function [a_lower,a_upper] = acc_ppi(C,alpha)
    
    A = C(1,1)+C(2,2) + 1;
    B = C(1,2)+C(2,1) + 1;
    
    a_lower = betainv(alpha/2,A,B);
    a_upper = betainv(1-alpha/2,A,B);
    
end

Contact us