'get recall and precision from internal records'

def _recall_prec(self, record, count):

    record = np.delete(record, np.where((record[:, 1].astype(int) == 0))[0], axis=0)
    sorted_records = record[record[:, 0].argsort()[::(-1)]]
    tp = np.cumsum((sorted_records[:, 1].astype(int) == 1))
    fp = np.cumsum((sorted_records[:, 1].astype(int) == 2))
    if (count <= 0):
        recall = (tp * 0.0)
    else:
        recall = (tp / float(count))
    prec = (tp.astype(float) / (tp + fp))
    return (recall, prec)
