def getStats(cm):
    """Return the usual stats for a confusion matrix."""

    measures = {}

    measures['recall'] = cm['TP'] / (cm['TP'] + cm['FN'])
    measures['specificity'] = cm['TN'] / (cm['TN'] + cm['FP'])
    measures['FPR'] = cm['FP'] / (cm['FP'] + cm['TN'])
    measures['FNR'] = cm['FN'] / (cm['TP'] + cm['FN'])
    measures['PBC'] = 100.0 * (cm['FN'] + cm['FP']) / (cm['TP'] + cm['FP'] + cm['FN'] + cm['TN'])
    measures['precision'] = cm['TP'] / (cm['TP'] + cm['FP'])
    measures['f-measure'] = 2.0 * (measures['recall'] * measures['precision']) / (measures['recall'] + measures['precision'])
    
    return measures