File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -559,7 +559,10 @@ def test_label_model_basic(self) -> None:
559
559
560
560
# Test estimated LF conditional probabilities
561
561
P_lm = label_model .get_conditional_probs ()
562
- np .testing .assert_array_almost_equal (P , P_lm , decimal = 2 )
562
+ conditional_probs_err = (
563
+ np .linalg .norm (P .flatten () - P_lm .flatten (), ord = 1 ) / P .size
564
+ )
565
+ self .assertLessEqual (conditional_probs_err , 0.01 )
563
566
564
567
# Test predicted labels
565
568
score = label_model .score (L , Y )
@@ -583,7 +586,10 @@ def test_label_model_sparse(self) -> None:
583
586
584
587
# Test estimated LF conditional probabilities
585
588
P_lm = label_model .get_conditional_probs ()
586
- np .testing .assert_array_almost_equal (P , P_lm , decimal = 2 )
589
+ conditional_probs_err = (
590
+ np .linalg .norm (P .flatten () - P_lm .flatten (), ord = 1 ) / P .size
591
+ )
592
+ self .assertLessEqual (conditional_probs_err , 0.01 )
587
593
588
594
# Test predicted labels *only on non-abstained data points*
589
595
Y_pred = label_model .predict (L , tie_break_policy = "abstain" )
You can’t perform that action at this time.
0 commit comments