
% this function applies the inverse ranked weighted mean algorithm of
% kadoda&mendes on the predictions of the best performing n-many methods

function [predictions] = irwm(predictions)

divider = 0;
for i = 1:size(predictions,1) 
    predictions(i,:) = predictions(i,:) * (size(predictions,1) - i + 1);
    divider = divider + (size(predictions,1) - i + 1);
end

predictions = sum(predictions) ./ divider;

end