PRTools contents |
COSTM
Y = COSTM(X,C,LABLIST)
W = COSTM([],C,LABLIST)
Maps the classifier output X (assumed to be posterior probability estimates) to the cost-outputs, defined by the cost-matrix C
C(i,j) = cost of misclassifying an object from class i as class j.
Default C is the cost matrix stored in the dataset X. The order of the classes is defined by LABLIST. When no lablist is given, the order as given by GETFEATLAB(X) is assumed. In order to apply this mapping, it is assumed that the dataset X represents posterior class probabilities (i.e. normalized by classc).
x = gendatb(100);
w1 = x*ldc; % standard classifier
C = [0 2; 1 0]; % new cost matrix
w2 = w1*classc*costm([],C); % classifier using this cost-matrix
mappings, classc, testd, testcost, setcost,
PRTools contents |