classification Report
时间: 2023-10-05 21:11:50 浏览: 45
Classification report is a tool used in machine learning to evaluate the performance of a classification model. It provides a summary of key metrics such as precision, recall, F1-score, and support for each class in the classification problem.
Precision is the ratio of true positives to the total number of true and false positives. It measures the accuracy of positive predictions.
Recall is the ratio of true positives to the total number of true positives and false negatives. It measures the ability of the classifier to identify positive instances.
F1-score is the harmonic mean of precision and recall. It provides a single score that balances both precision and recall.
Support is the number of samples in each class.
A classification report typically looks like the following:
```
precision recall f1-score support
Class 0 0.80 0.90 0.85 50
Class 1 0.70 0.50 0.58 30
Class 2 0.62 0.70 0.66 40
micro avg 0.73 0.73 0.73 120
macro avg 0.71 0.70 0.69 120
weighted avg 0.72 0.73 0.72 120
```
In the above report, we have three classes (Class 0, Class 1, and Class 2) and 120 samples in total. The micro-average F1-score is 0.73, which indicates the overall performance of the classifier. The macro-average F1-score is 0.69, which gives equal weight to each class. The weighted-average F1-score is 0.72, which takes into account the support for each class.