본문 바로가기

기계학습

About recall, precision

About recall, precision

회사에서 tensorflow, konlpy 과 같은 라이브러리를 이용해 자연어 처리를 하면서 헷갈렸던 용어를 정리해보았습니다.
recall, precision는 실험 데이터 검증 등에 자주 사용하는 용어로, 알아두면 좋은 개념들입니다. :)

거의 모든 자료는 위키피디아 에서 가져왔으며, 별도 출처는 자료 하단에 작성하였습니다.

Recision and Recall

In pattern recognition and information retrieval with binary classification, precision (also called positive predictive value) is the fraction of retrieved instances that are relevant, while recall (also known as sensitivity) is the fraction of relevant instances that are retrieved. Both precision and recall are therefore based on an understanding and measure of relevance.

위 설명은 위키피디아에 상단에 있는 정밀도(precision)과 재현율(recall)의 설명 전문이다.

조금 풀어쓰자면

시스템이 가져온 결과(retrieved documents) 중 원하는 결과(relevant documents)의 비율을 precision이라고 하고


원하는 결과에서 시스템이 실제로 가져온 결과를 recall이라고 한다.


위 요소를 그림으로 정리하면 아래와 같다.

위에서 구한 precisionrecall은 단순히 양적인 비교에 의미를 둔다. 이제 서로 다른 알고리즘 (시스템에서 사용한) 을 비교하고 싶다면 추가적인 처리가 필요하다.

Sensitivity, Specificity 를 사용할 때는 Accuracy를 계산할 수 있고,
위에서 설명한 방법으로 Precision, Recall을 이용할 때는 F1-score를 사용할 수 있다.

2 x (Precision x Recall) / (Precision + Recall)

(여기서 x 는 곱셈을 의미한다.)

여기서 다룬 내용 이외에 FDR이나 PPV precision 와 같은 추가 분석에 관심 있다면 아래 표를 참고하는 것도 좋을 것 같다.

출처: 위키피디아

출처

  1. https://en.wikipedia.org/wiki/Precision_and_recall
  2. https://sites.google.com/site/torajim/articles/performance_measure
  3. https://www.cheonghyun.com/ko/precision-vs-recall/
  4. http://kaspyx.kr/9