classification-metrics-python
classification-metrics-python copied to clipboard
This is a simple python example to recreate classification metrics like F1 Score, Accuracy
print('Accuracy for Logistic Regression :', 100* accuracy_score(df.y_act, df.y_pred_lr)) print('Accuracy for Logistic Regression :', 100*accuracy_score(df.y_act, # Accuracy for Random Forest df.y_pred_rf))
def compute_tp_tn_fn_fp(y_act, y_pred): ''' True positive - actual = 1, predicted = 1 False positive - actual = 1, predicted = 0 # False positive - actual = 0, predicted...