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

    Parameters
    ----------
    antecedents_support : float
        support of antecedents.
            for example :
                - 0.43

    combination_support : float
        support of combination.
            for example :
                - 0.35

    Returns
    -------
    confidence of antecedents and combination.
        for example :
            = 0.35 / 0.43
            = 0.813

    """

    try:
        confidence = combination_support / antecedents_support

        return round(confidence, 3)
    except ZeroDivisionError:
        raise ValueError("antecedents support supposed not be zero !")