def __obj_assign_handler__(cm, matrix_param):
    """
    Assign basic parameters to ConfusionMatrix.

    :param cm: ConfusionMatrix
    :type cm : pycm.ConfusionMatrix object
    :param matrix_param: matrix parameters
    :type matrix_param: dict
    :return: None
    """
    cm.classes = matrix_param[0]
    cm.table = matrix_param[1]
    cm.matrix = cm.table
    cm.normalized_table = normalized_table_calc(cm.classes, cm.table)
    cm.normalized_matrix = cm.normalized_table
    cm.TP = matrix_param[2]
    cm.TN = matrix_param[3]
    cm.FP = matrix_param[4]
    cm.FN = matrix_param[5]
    statistic_result = class_statistics(
        TP=matrix_param[2],
        TN=matrix_param[3],
        FP=matrix_param[4],
        FN=matrix_param[5],
        classes=matrix_param[0],
        table=matrix_param[1])
    cm.class_stat = statistic_result
    cm.overall_stat = overall_statistics(
        RACC=statistic_result["RACC"],
        RACCU=statistic_result["RACCU"],
        TPR=statistic_result["TPR"],
        PPV=statistic_result["PPV"],
        TP=statistic_result["TP"],
        FN=statistic_result["FN"],
        FP=statistic_result["FP"],
        POP=statistic_result["POP"],
        P=statistic_result["P"],
        TOP=statistic_result["TOP"],
        jaccard_list=statistic_result["J"],
        classes=cm.classes,
        table=cm.table,
        CEN_dict=statistic_result["CEN"],
        MCEN_dict=statistic_result["MCEN"],
        AUC_dict=statistic_result["AUC"])
def __obj_assign_handler__ ( cm , matrix_param ) : cm . classes = matrix_param [ 0 ] cm . table = matrix_param [ 1 ] cm . matrix = cm . table cm . normalized_table = normalized_table_calc ( cm . classes , cm . table ) cm . normalized_matrix = cm . normalized_table cm . TP = matrix_param [ 2 ] cm . TN = matrix_param [ 3 ] cm . FP = matrix_param [ 4 ] cm . FN = matrix_param [ 5 ] statistic_result = class_statistics ( TP = matrix_param [ 2 ] , TN = matrix_param [ 3 ] , FP = matrix_param [ 4 ] , FN = matrix_param [ 5 ] , classes = matrix_param [ 0 ] , table = matrix_param [ 1 ] ) cm . class_stat = statistic_result cm . overall_stat = overall_statistics ( RACC = statistic_result [ "RACC" ] , RACCU = statistic_result [ "RACCU" ] , TPR = statistic_result [ "TPR" ] , PPV = statistic_result [ "PPV" ] , TP = statistic_result [ "TP" ] , FN = statistic_result [ "FN" ] , FP = statistic_result [ "FP" ] , POP = statistic_result [ "POP" ] , P = statistic_result [ "P" ] , TOP = statistic_result [ "TOP" ] , jaccard_list = statistic_result [ "J" ] , classes = cm . classes , table = cm . table , CEN_dict = statistic_result [ "CEN" ] , MCEN_dict = statistic_result [ "MCEN" ] , AUC_dict = statistic_result [ "AUC" ] )
Assign basic parameters to ConfusionMatrix.

    :param cm: ConfusionMatrix
    :type cm : pycm.ConfusionMatrix object
    :param matrix_param: matrix parameters
    :type matrix_param: dict
    :return: None