% this function compares the mdmre of new predictions with the
% mean mdmre of the old predictions. If there is no reduction in the mdmre
% values, then decision is not to ask any more labels. If there is a
% reduction, then decision is to ask more labels.
function [askMore] = decideMoreLabels(newPredictions, oldPredictions, myActuals)

% before everything check if this is the first time a label is asked
% if yes, then askMore is true and return here!
if size(oldPredictions,1) == 0
    askMore = 1;
    return;
end

% calculate new mdmre
newMdmre = median(abs(newPredictions - myActuals) ./ myActuals);

% calculate new mdmre
oldMdmres = -1 * ones(size(oldPredictions,1),1);
for i = 1:size(oldPredictions,1)
    oldMdmres(i) = median(abs(oldPredictions(i,:) - myActuals)./myActuals);
end
meanOldMdmre = median(oldMdmres);

% compare old and new mdmres and make the decison
if newMdmre < meanOldMdmre
    askMore = 1;
else
    askMore = 0;
end

end