def DF_calc(classes):
    """
    Calculate chi-squared degree of freedom.

    :param classes: confusion matrix classes
    :type classes : list
    :return: DF as int
    """
    try:
        return (len(classes) - 1) ** 2
    except Exception:
        return 'None'
