#pr2 confusion matrix

import pandas as pd
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score


df = pd.read_excel(r"C:\Users\Downloads\covid_confusion_matrix_dataset (1).xlsx")  # 

df["Actual Status"] = df["Actual Status"].map({"Positive": 1, "Negative": 0})
df["Predicted Status"]= df["Predicted Status"].map({"Positive": 1, "Negative": 0})
print(df)


accuracy = accuracy_score(df["Actual Status"], df["Predicted Status"])
precision = precision_score(df["Actual Status"], df["Predicted Status"])
recall = recall_score(df["Actual Status"], df["Predicted Status"])
f1 = f1_score(df["Actual Status"], df["Predicted Status"])


print("Accuracy :", accuracy)
print("Precision:", precision)
print("Recall   :", recall)
print("F1 Score :", f1)