Calculated average precision and rank with plots