def RR_calc(classes, TOP):
    """
    Calculate Global performance index (RR).

    :param classes: confusion matrix classes
    :type classes: list
    :param TOP: number of positives in predict vector per class
    :type TOP: dict
    :return: RR as float
    """
    try:
        class_number = len(classes)
        result = sum(list(TOP.values()))
        return result / class_number
    except Exception:
        return "None"