choosa = sum(M(1:choose, :));
choosb = sum(M(choose+1:2*choose, :));
thisc = choosa;
thatc = choosb;
decsrf = [];
right = 0;
wrong = 0;

for d = 1:dsize(1)
	magn(d) = kernel(data(d,:), data(d,:));
end

for x = 1:dsize(1)
	me = data(x,:);
	for d= 1:dsize(1)
		mygamma(d) = kernel(me, data(d,:));
	end
	A = gamma(1,:)'*gamma(1,:);
	dis = sum(sum(A.*prekern))-2*sum(gamma(1,:).*mygamma);
	best = dis;
	bclust = 1;
	distance(x, 1) = dis;
	for c = 2:nclust
		A = gamma(c,:)'*gamma(c,:);
		dis = sum(sum(A.*prekern))-2*sum(gamma(c,:).*mygamma);
		distance(x, c) = dis;
		if(dis < best)
			best = dis;
			bclust = c;
		end
	end
	if(bclust ~= whichclust(x))
		wrong = wrong+1;
	else
		right = right +1;
	end
	wrong./(right+wrong)
	end
end


