'Peek the non-interpolated average precision at n.
Returns:
The non-interpolated average precision at n (default 0).
If n is larger than the length of the ranked list,
the average precision will be returned.'

def peek_ap_at_n(self):

    if (self.heap_size <= 0):
        return 0
    predlists = numpy.array(list(zip(*self._heap)))
    ap = self.ap_at_n(predlists[0], predlists[1], n=self._top_n, total_num_positives=self._total_positives)
    return ap
