def cal_confidence(antecedents_support, combination_support):
    """
    calculate confidence of antecedents and consequents

    Parameters
    ----------
    antecedents_support : float
        support of antecedents.
    combination_support : float
        support of combination.

    Returns
    -------
    confidence of antecedents and combination.

    """

    try:
        return combination_support / antecedents_support
    except ZeroDivisionError:
        return 0