0

When using pycaret to do binary classification (label 0 and 1), which one is considered to be 'positive' when calculating recall, precision etc.?

For example, I'm trying to build a model to predict if a patient have a certain disease(0-negative, 1-positive). My intention is to aim for a high recall to avoid situations in which the disease is not detected. When I plot the confusion matrix, 0 appears at the place where 'positive' supposes to be in a normal confusion matrix. I'm so confusing. Do I need to switch 0 and 1?

Any help is appreciated!

Biggie
  • 1

1 Answers1

0

Maybe a solution is to create a 'manual' plot rather than using the integrated package. You can change the layout of the heatmap if you like.

import seaborn as sns
import matplotlib.pyplot as plt
matrix = confusion_matrix(y_test, y_pred)
sns.heatmap(matrix.T, annot=True)
plt.title("Confusion Matrix")
plt.ylabel("Actuals")
plt.xlabel("Predictions")
plt.ylim(0,2)
plt.xlim(2,0)
Kylian
  • 319
  • 2
  • 14
  • Hi! Thanks for the reply. But I think my point is not the layout of the plot. My question really is: With input target 0 and 1, which one is considered as 'positive' when calculating recall and why. – Biggie Jan 26 '22 at 09:48