def NIR_calc(P, POP):
    """
    Calculate No information rate (NIR).

    :param P: number of actual positives per class
    :type P: dict
    :param POP: population or total number of samples
    :type POP: int
    :return: NIR as float
    """
    try:
        max_P = max(list(P.values()))
        length = POP
        return max_P / length
    except Exception:
        return "None"