function [L1err,L2err,rankedErr]=evalPDEachMovie(activeMatTrain,... activeMatTest,otherMat,K,coeff,sigma,numValues,lowRate,highRate,type) valVec=1:numValues; for j=1:size(activeMatTest,1), %discreate case if(type == 0) activeMatTrain = floor(activeMatTrain); otherMat = floor(otherMat); [pred,predMean]=predictPreferencePD(activeMatTrain(j,:), otherMat,... numValues,sigma); else %continuous case predMean=predictPreferencePDcont(activeMatTrain(j,:), activeMatTest(j,:),otherMat,... lowRate,highRate,sigma); %display(j); %display(predMean); end ind = find(activeMatTest(j,:)>0); predPref = predMean(ind); truePref = full(activeMatTest(j,ind)); L2err(j)=mean((predPref-truePref).^2); L1err(j)=norm(predPref-truePref,1)/length(predPref); %rankedErr(j)=rankedEvalCF(predPref,truePref,K,coeff); rankedErr(j)=myRankedEvalCF(activeMatTrain(j,:),predPref,truePref,K,coeff); end