fea = rand(50,70); gnd = [ones(10,1);ones(15,1)*2;ones(10,1)*3;ones(15,1)*4]; res = kmeans(fea,4); res = bestMap(gnd,res); %============= evaluate AC: accuracy ============== AC = length(find(gnd == res))/length(gnd); %============= evaluate MIhat: nomalized mutual information ================= MIhat = MutualInfo(gnd,res);
% Windows 7 on Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz with 16G memory % Matlab R2011b (7.13.0.564) 64-bit (win64) % MNIST data set (70000 samples with 784 dimensions) clear; load('Orig.mat'); % litekmeans tic;[label, center] = litekmeans(fea, 200, 'MaxIter', 20);toc Elapsed time is 11.515731 seconds. % kmeans provided in Matlab tic;[label, center] = kmeans(fea, 200, 'OnlinePhase','off','MaxIter', 20);toc Elapsed time is 237.617422 seconds.