mdr/utils/utils.py
def mdr_entropy(X, Y, labels, base=2):
    """Calculates the MDR entropy, H(XY), in the given base

    MDR entropy is calculated by combining variables X and Y into a single MDR model then calculating
    the entropy of the resulting model's predictions.

    Parameters
    ----------
    X: array-like (# samples)
        An array of values corresponding to one feature in the MDR model
    Y: array-like (# samples)
        An array of values corresponding to one feature in the MDR model
    labels: array-like (# samples)
        The class labels corresponding to features X and Y
    base: integer (default: 2)
        The base in which to calculate MDR entropy

    Returns
    ----------
    mdr_entropy: float
        The MDR entropy calculated according to the equation H(XY) = -sum(p_xy * log p_xy) for all output states of the MDR model

    """
    return entropy(_mdr_predict(X, Y, labels), base=base)
def mdr_entropy(X, Y, labels, base=2):
    """Calculates the MDR entropy, H(XY), in the given base

    MDR entropy is calculated by combining variables X and Y into a single MDR model then calculating
    the entropy of the resulting model's predictions.

    Parameters
    ----------
    X: array-like (# samples)
        An array of values corresponding to one feature in the MDR model
    Y: array-like (# samples)
        An array of values corresponding to one feature in the MDR model
    labels: array-like (# samples)
        The class labels corresponding to features X and Y
    base: integer (default: 2)
        The base in which to calculate MDR entropy

    Returns
    ----------
    mdr_entropy: float
        The MDR entropy calculated according to the equation H(XY) = -sum(p_xy * log p_xy) for all output states of the MDR model

    """
    return entropy(_mdr_predict(X, Y, labels), base=base)
def mdr_entropy ( X , Y , labels , base = 2 ) : return entropy ( _mdr_predict ( X , Y , labels ) , base = base )
Calculates the MDR entropy, H(XY), in the given base

    MDR entropy is calculated by combining variables X and Y into a single MDR model then calculating
    the entropy of the resulting model's predictions.

    Parameters
    ----------
    X: array-like (# samples)
        An array of values corresponding to one feature in the MDR model
    Y: array-like (# samples)
        An array of values corresponding to one feature in the MDR model
    labels: array-like (# samples)
        The class labels corresponding to features X and Y
    base: integer (default: 2)
        The base in which to calculate MDR entropy

    Returns
    ----------
    mdr_entropy: float
        The MDR entropy calculated according to the equation H(XY) = -sum(p_xy * log p_xy) for all output states of the MDR model
Calculates the MDR entropy H ( XY ) in the given base