def f_score(precision, recall, beta=1):
    """Compute F beta score
    
    Args:
        precision (float): precision
        recall (float): recall
        beta (float): the weight of recall, default=1
    
    Returns:
        float: f score
    """
    
    if recall + precision*beta**2 == 0:
        return 0
    else:        
        return (1 + beta**2)*precision*recall / (recall + precision*beta**2)