def count(y_true, y_score=None, countna=False):
    """
    Counts the number of examples. If countna is False then only count labeled examples,
    i.e. those with y_true not NaN
    """
    if not countna:
        return (~np.isnan(to_float(y_true))).sum()
    else:
        return len(y_true)