def f1_score (true_positive, positive, gt_positive):
    """Compute the F1-score

    Args:
        true_positive (Int): Number of true positives
        positive (Int): Number of positively classified samples
        gt_positive (Int): Number of effectively positive samples

    Returns:
        float: F1-score
    """
    if positive <= 0 or gt_positive <= 0 or true_positive <= 0:
        return 0
    precision = true_positive / positive
    recall = true_positive / gt_positive

    return 2 / (1 / precision + 1 / recall)