pythonscikit-learn

what is "Support" in classification_report within sklearn?


I have been wrote a code and the result was a report which you can seen blow. the code is about the number of people who survived or died in titanic. my question is what is "Support" in this report?

              precision    recall  f1-score   support

           0       0.78      0.87      0.82       154
           1       0.79      0.67      0.72       114

    accuracy                           0.78       268
   macro avg       0.79      0.77      0.77       268
weighted avg       0.78      0.78      0.78       268

Now I found an explanation about "Support" on the internet which is: "Support is the number of actual occurrences of the class in the dataset. It doesn’t vary between models, it just diagnoses the performance evaluation process." I didn't understood what is "actual occurrences" means as well. I would be grateful if someone could explain these definitions to me with an example.


Solution

  • support is how many samples are in each class. In your case, 154 samples are in class 0, and 114 samples are in class 1. The total number of samples is 268.

    It uses the ground truth labels, which represent the actual class of each sample.

    You might be interested in seeing how these values can be manually calculated - see https://stackoverflow.com/a/76789551/21896093