CMSC_828C_Project1/KNN_PCA.py
def cf_matrix_norm(cfm):
    """
    This function normalizes the confusion matrix
    :param cfm: confusion matrix
    :return: normalized confusion matrix
    """
    row_sums = cfm.sum(axis=1, keepdims=True)
    norm_conf_mx = cfm / row_sums
    np.fill_diagonal(norm_conf_mx, 0)
    return norm_conf_mx

    This function normalizes the confusion matrix
    :param cfm: confusion matrix
    :return: normalized confusion matrix
    
This function normalizes the confusion matrix
This function normalizes the confusion matrix
def cf_matrix_norm(cfm):
    row_sums = cfm.sum(axis=1, keepdims=True)
    norm_conf_mx = cfm / row_sums
    np.fill_diagonal(norm_conf_mx, 0)
    return norm_conf_mx
def cf_matrix_norm ( cfm ) : row_sums = cfm . sum ( axis = 1 , keepdims = True ) norm_conf_mx = cfm / row_sums np . fill_diagonal ( norm_conf_mx , 0 ) return norm_conf_mx
This function normalizes the confusion matrix
This function normalizes the confusion matrix
"""
    This function normalizes the confusion matrix
    :param cfm: confusion matrix
    :return: normalized confusion matrix
    """
normalized confusion matrix
normalized confusion matrix
cfm
None