def CM(row):
    """
    Confusion matrix function to classify true positive, false positive, false negative, or true negative
    classifications
    :param row: Series
                Predicted and true classification of the current dam being evaluated
    :return: str
                Classification type
    """
    if row['True Hazard Class'] == 'H' and row['Predicted Hazard Class'] == 'H':
        return 'TN'
    elif row['True Hazard Class'] == 'NH' and row['Predicted Hazard Class'] == 'NH':
        return 'TP'
    elif row['True Hazard Class'] == 'H' and row['Predicted Hazard Class'] == 'NH':
        return 'FP'
    elif row['True Hazard Class'] == 'NH' and row['Predicted Hazard Class'] == 'H':
        return 'FN'