机器学习——准确率、精度、召回率和F1分数(Machine Learning - Accuracy, Precision, Recall, F1-Score)

Evaluation of Machine Learning Algorithm
Once you have done a machine learning model for classification problem, we want to know the accuracy of prediction of the model. We can use accuracy, precision, recall and f1-score to show how good the model is.

Basic Terms

Positive(P): The ground truth is positive (e.g. it is an iPhone)
Negative(N): The ground truth is negative (e.g. it is not an iPhone)
True Positive(TP): The prediction is positive; The ground truth is positive.
False Positive(FP): The prediction is positive; The ground truth is negative.
True Negative(TN): The prediction is negative; The ground truth is negative.
False Negative(FN): The prediction is negative; The ground truth is positive.

Error
Proportion of all predictions that are incorrect. Error is a measurement of how bad a model is.
这里写图片描述

Accuracy
Proportion of all predictions that are correct. Accuracy is a measurement of how good a model is.
这里写图片描述

Precision
Proportion of all positive predictions that are correct. Precision is a measurement of how many positive predictions were actual positive observations.
这里写图片描述

Recall
Proportion of all real positive observations that are correct. Precision is a measure of how many actual positive observations were predicted correctly.
这里写图片描述

F1-Score
The harmonic mean of precision and recall. F1 score is an ‘average’ of both precision and recall. We use the harmonic mean because it is the appropriate way to average ratios (while arthmetric mean is appropriate when it conceptually makes sense to add things up).
这里写图片描述

示例
机器学习——准确率、精度、召回率和F1分数(Machine Learning - Accuracy, Precision, Recall, F1-Score)_第1张图片
Error=4/8=50%
Accuracy=4/8=50%
Precision=1/4=25%
Recall=1/2=50%
F1-score=33.3%

最后再说两句(PS)
We can use those measurements to compare performance of multiple machine learning algorithms.

More resources 1, 2, 3, 4.

Welcome questions always and forever.

你可能感兴趣的:(机器学习)