def statistics(prediction, ground_truth, beta=1):
    """Computes performance statistics for classifiers.

    Parameters
    ----------
    prediction : set
        Set of objects predicted to be labeled positive.

    ground_truth : set
        Set of objects actually labeled positive.

    beta : float, optional
        Sets the beta for an F-beta score. Defaults to 1.

    Returns
    -------
    (float, float, float)
        Tuple representing (precision, recall, f_beta).
    """
    true_positives = ground_truth & prediction
    false_positives = prediction - ground_truth

    if len(prediction) == 0: # to avoid division-by-zero errors
        precision = 0.0
    else:
        precision = len(true_positives) / (len(true_positives) + len(false_positives))
    
    recall = len(true_positives) / len(ground_truth)
    
    if precision == 0.0 and recall == 0.0: # to avoid division-by-zero errors
        f_beta = 0.0
    else:
        f_beta = (1 + beta ** 2) * (precision * recall) / ((beta ** 2 * precision) + recall)
    
    return (precision, recall, f_beta)