Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions snorkel/analysis/error_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ def get_label_buckets(*y: np.ndarray) -> Dict[Tuple[int, ...], np.ndarray]:
>>> buckets = get_label_buckets(Y_gold, Y_pred)

The returned ``buckets[(i, j)]`` is a NumPy array of data point indices with
predicted label i and true label j.
true label i and predicted label j.

More generally, the returned indexes (i,j,k,...) match the order of labels passed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing to use i and j here with a different meaning than i and j just two lines above. How about "The returned indices within each bucket refer to the order of the labels that were passed in."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is clearer!

as function args.

>>> buckets[(1, 1)] # true positives
array([0, 1])
>>> (1, 0) in buckets # false negatives
>>> (1, 0) in buckets # false positives
False
>>> (0, 1) in buckets # false positives
>>> (0, 1) in buckets # false negatives
False
>>> (0, 0) in buckets # true negatives
False
Expand Down