Skip to content

Commit

Permalink
Add confusion matrix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 committed Apr 19, 2016
1 parent c9e2137 commit 7a856a0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion recordlinkage/measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,23 @@ def false_negatives(true_match_index, matches_index):
return len(true_match_index - matches_index)

def confusion_matrix(true_match_index, matches_index, pairs):
""" Return the confusion matrix.
"""
Compute the confusion matrix. The confusion matrix has the following shape:
+---------------------+-----------------------+----------------------+
| | Predicted Positive | Predicted Negatives |
+=====================+=======================+======================+
| **True Positive** | True Positives (TP) | False Negatives (FN) |
+---------------------+-----------------------+----------------------+
| **True Negative** | False Positives (FP) | True Negatives (TN) |
+---------------------+-----------------------+----------------------+
The confusion matrix is used to compute measures like precision and recall.
:param true_match_index: The golden/true links.
:param match_index: The classified links.
:param pairs: The number of record pairs analysed.
:return:
:rtype: numpy.array
Expand Down

0 comments on commit 7a856a0

Please sign in to comment.