Skip to content

Commit 7793f0d

Browse files
committed
BH comments
1 parent 02d898c commit 7793f0d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

snorkel/labeling/model/label_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def score(
455455
L
456456
An [n,m] matrix with values in {-1,0,1,...,k-1}
457457
Y
458-
Gold labels associated with datapoints in L
458+
Gold labels associated with data points in L
459459
metrics
460460
A list of metric names
461461
tie_break_policy
@@ -479,7 +479,7 @@ def score(
479479
"""
480480
if tie_break_policy == "abstain": # pragma: no cover
481481
logging.warning(
482-
"Metrics calculated over datapoints with non-abstain labels only"
482+
"Metrics calculated over data points with non-abstain labels only"
483483
)
484484

485485
Y_pred, Y_prob = self.predict(

test/analysis/test_scorer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def test_abstain_labels(self) -> None:
7676

7777
# Test abstain=-1 for preds and gold
7878
abstain_preds = np.array([-1, -1, 1, 1, 0])
79-
abstain_probs = np.array([0.5, 0.5, 0.9, 0.7, 0.4])
80-
results = scorer.score(golds, abstain_preds, abstain_probs)
79+
results = scorer.score(golds, abstain_preds)
8180
results_expected = dict(accuracy=0.5)
8281
self.assertEqual(results, results_expected)
8382

test/labeling/model/test_label_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def test_predict_proba(self):
240240
np.testing.assert_array_almost_equal(probs, true_probs)
241241

242242
def test_predict(self):
243+
# 3 LFs that always disagree/abstain leads to all abstains
243244
L = np.array([[-1, 1, 0], [0, -1, 1], [1, 0, -1]])
244245
label_model = LabelModel(cardinality=2, verbose=False)
245246
label_model.fit(L, n_epochs=100)

0 commit comments

Comments
 (0)