def f1(y, z):
    """F1 score: `2 * (p * r) / (p + r)`, where p=precision and r=recall.
    """
    _recall = recall(y, z)
    _prec = precision(y, z)
    return 2 * (_prec * _recall) / (_prec + _recall)