代码改变世界

two measures precision and recall of classification

2016-11-04 16:58  不知道怎么取名字  阅读(327)  评论(0编辑  收藏  举报

   In pattern recognition and information retrievial with binary classification , there are some measures ,such as recall , precision。

   In classification task, the precision for a class is the number of true positive divided by the total number of  elements labeled as belonging to the positive class(i.e. the sum of true positives and false positives ,which are items incorrectly labeled as belonging to the class.)  And the recall, in this context, is defined as the number of true positives divided by the total numble of elements that actually belonging to the positive class(i.e. the sum of true positive and false negative .

  Definition(In classification context)

    for classification tasks, the terms true positve ,false positive ,true negative , false negative ,compare the results of the classifier under test with trusted external judgment.

   The terms positive and negative refer to the classifier's prediction(sometimes known as the expection),and the terms true and false refer to whether that prediction corresponds to the external jugement(sometimes known as te observation)。

   Let us define an experiment from P positive instances and N negative instances for some condition. The four outcomes can be formulated in a 2×2 contingency table or confusion matrix, as follows: 

Precision and recall are then defined as:

   precision = tp/(tp+fp)

    recall = tp/(tp+fn)

Recall in this context is alse referred to as the true positive rate or sensitivity, and precision is alse referred to positive predictive vaule(PPV), some other related measures used in classification include true negative rate and accuracy. True negatvie rate is alse called specificty.

 

 

reference:

1、wikipedia : Precision and recall

2、Fawcett, Tom (2006). "An Introduction to ROC Analysis". Pattern Recognition Letters27 (8): 861 – 874. doi:10.1016/j.patrec.2005.10.010.