def METHOD_NAME(confmat: Tensor) -> Tensor:
    r"""Compute Conditional Entropy Statistic based on a pre-computed confusion matrix.
    .. math::
        H(X|Y) = \sum_{x, y ~ (X, Y)} p(x, y)\frac{p(y)}{p(x, y)}
    Args:
        confmat: Confusion matrix for observed data
    Returns:
        Conditional Entropy Value
    """
    confmat = _drop_empty_rows_and_cols(confmat)
    total_occurrences = confmat.sum()
    # iterate over all i, j combinations
    p_xy_m = confmat / total_occurrences
    # get p_y by summing over x dim (=1)
    p_y = confmat.sum(1) / total_occurrences
    # repeat over rows (shape = p_xy_m.shape[1]) for tensor multiplication
    p_y_m = p_y.unsqueeze(1).repeat(1, p_xy_m.shape[1])
    # entropy calculated as p_xy * log (p_xy / p_y)
    return torch.nansum(p_xy_m * torch.log(p_y_m / p_xy_m))