mas01mc@291: function plotLSHresults(filename, w, kk, useLog) mas01mc@291: if nargin<4, useLog=0;end mas01mc@291: if nargin<3, kk=1;end mas01mc@291: mas01mc@291: R = load(filename,'ascii'); % Assume 10 radii queries x 10 radii result summaries mas01mc@291: mas01mc@291: for k=1:10 mas01mc@291: RR(k,:)=mean(R(k:10:end,:))./100; % Convert to Probability mas01mc@291: end mas01mc@291: mas01mc@291: c=['r' 'g' 'b' 'c' 'm' 'y' 'k']; mas01mc@291: mas01mc@291: if(useLog) mas01mc@291: logSym=' Log_{10} '; mas01mc@291: else mas01mc@291: logSym=''; mas01mc@291: end mas01mc@291: mas01mc@291: figure mas01mc@291: subplot(211) mas01mc@291: hold on mas01mc@291: radii=[0.1 0.2 0.4 0.5 0.7 0.9 1 2 5 10]; mas01mc@291: for k=1:10 mas01mc@291: if(useLog) mas01mc@291: semilogx(radii, kk*log10(lshP(w,radii./radii(k))),[num2str(c(mod(k,length(c))+1)) '-+'],'lineWidth',2) mas01mc@291: else mas01mc@291: plot(radii,lshP(w,radii./radii(k)).^kk,[num2str(c(mod(k,length(c))+1)) '-+'],'lineWidth',2) mas01mc@291: end mas01mc@291: end mas01mc@291: if(useLog) mas01mc@291: axis([radii(1) radii(end) -kk 0]) mas01mc@291: else mas01mc@291: axis([0 10 0 1]) mas01mc@291: end mas01mc@291: grid on mas01mc@291: legend([{"r=.1"},{"r=.2"},{"r=.4"},{"r=.5"},{"r=.7"},{"r=.9"},{"r=1"},{"r=2"},{"r=5"},{"r=10"}]) mas01mc@291: title(['Estimated Probability for 10 LSH radii searches: w=' num2str(w) ' , k=' num2str(kk)]) mas01mc@291: xlabel('Radius') mas01mc@291: ylabel([logSym 'Probability']) mas01mc@291: mas01mc@291: mas01mc@291: subplot(212) mas01mc@291: hold on mas01mc@291: for k=1:10 mas01mc@291: if(useLog) mas01cr@645: semilogx(radii,kk*log10(RR(k,:)),[num2str(c(mod(k,length(c))+1)) '-+'],'lineWidth',2) mas01mc@291: else mas01mc@291: plot(radii,RR(k,:).^kk,[num2str(c(mod(k,length(c))+1)) '-+'],'lineWidth',2) mas01mc@291: end mas01mc@291: end mas01mc@291: if(useLog) mas01mc@291: axis([radii(1) radii(end) -kk 0]) mas01mc@291: else mas01mc@291: axis([0 10 0 1]) mas01mc@291: endif mas01mc@291: grid on mas01mc@291: legend([{"r=.1"},{"r=.2"},{"r=.4"},{"r=.5"},{"r=.7"},{"r=.9"},{"r=1"},{"r=2"},{"r=5"},{"r=10"}]) mas01mc@291: title(['Observed Probability for 10 LSH radii searches: w=' num2str(w) ' , k=' num2str(kk)]) mas01mc@291: xlabel('Radius') mas01mc@291: ylabel([logSym 'Probability']) mas01mc@291: