clustc
CLUSTC
Classify cluster objects on the basis of (some) class labels
including confidences by combining clustering levels.
[LABOUT,CONF] = CLUSTC(LABC,LABT)
[LABOUT,CONF] = LABC*CLUSTC(LABT)
Input | LABC | Index array, size [M,K], indices of cluster prototypes for M objects in K clusterings. | LABT | Vector of M elements with true object labels. Preferably numbers between 1 and C, if C is the number of classes. Unknowns should be given by 0. |
Output | LABOUT | Class labels assigned to all objects based on the maximum confidence. | CONF | Array, size MxC, with class confidences for all objects. |
Description Initially all labeled objects are given a confidence, one for the particular class and zero for all other classes. Next, from the highest cluster level (smallest number of clusters) downwards, all class confidences of all objects are updated by adding the average class confidences of the cluster to which they belong, similar to the sum rule of classifier combiners.
The numeric class labels LABT can be obtained from a partially labeled PRTools dataset A by LABT = GETNLAB(A);
For good results the clustering levels of LABC should be diverse. In particular they should not be nested.
Do not call this routine as a mapping in case LABC is a single level clustering. It generates a hard to understand error. Example(s)
randreset % define random initialisation
a = gendatclust(3000); % generate 3000 2D objects in 10 clusters
labn = getnlab(a); % its numeric labels
x = +a; % the unlabeled dataset
labc = clustk(x,[20 25 35 50 100 200]); % cluster by multilevel kmeans
L = unique(labc(:,1)); % The prototypes in the first cluster level
labt = zeros(size(x,1),1); % construct labt, unlabeled
labt(L) = labn(L); % labeled part (20 objects)
labout = clustc(labc,labt); % run clustc
e1 = mean(labout~=labn); % compare output with true labels
e2 = a*knnc(a(L,:),1)*testc; % result of using prototypes in 1NN
fprintf('\n160 objects of which 20 cluster prototypes are labeled\n')
fprintf('%5.3f error using clustering based confidences\n',e1)
fprintf('%5.3f error using prototypes only\n',e2)
See also
datasets, mappings, dclusth, cluste, clustf, clusth, clustk, clustm, dcluste, dclusth, dclustk, dclustm, clusteval, clustcerr, clustnum, clusthc, plotdg, This file has been automatically generated. If badly readable, use the help-command in Matlab. |
|