train_model.py
def performance(actual, pred):

    f1 = f1_score(actual, pred)
    accuracy = accuracy_score(actual, pred)
    precision = precision_score(actual, pred)

    return f1, accuracy, precision

Performance metrics