
	 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	 
function [ret] = purity (y,L)
	c = unique(y); c = reshape(c,[1,length(c)])
	summ=0;
	for t = c
		t;
		ind  = find(y==t);
		[l,f] = mode(L(ind));
		summ = summ +f;
	end;
	ret = summ / length(y);
return;