[PATCH] D93112: LNT: Fix large Mann-Whitney U Test.

Tamar Christina via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 05:57:24 PST 2020


tnfchris created this revision.
tnfchris added reviewers: thopre, kongyi.
tnfchris requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The call to mannwhitneyu_large returns a tuple of two results (the U
statistic and the one-sided p value). This causes a crash when running
with Python 3 due to the comparison between a float and a tuple, however
appears to silently fail with Python 2 which is possibly why it was not
caught sooner.

Since we only care about the one-sided p value, just take that directly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93112

Files:
  lnt/util/stats.py


Index: lnt/util/stats.py
===================================================================
--- lnt/util/stats.py
+++ lnt/util/stats.py
@@ -82,7 +82,7 @@
     else:
         try:
             # MWU in SciPy is one-sided, multiply by 2 to get two-sided.
-            p = mannwhitneyu_large(a, b) * 2
+            p = mannwhitneyu_large(a, b)[1] * 2
             return p >= sigLevel
         except ValueError:
             return True


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93112.311200.patch
Type: text/x-patch
Size: 436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201211/8d42d50d/attachment.bin>


More information about the llvm-commits mailing list