Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Side by Side Diff: dashboard/dashboard/pinpoint/models/mann_whitney_u.py

Issue 3019503002: [pinpoint] Move mann_whitney_u.py to models/ (Closed)
Patch Set: Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Pure Python implementation of the Mann-Whitney U test. 5 """Pure Python implementation of the Mann-Whitney U test.
6 6
7 This code is adapted from SciPy: 7 This code is adapted from SciPy:
8 https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py 8 https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py
9 Which is provided under a BSD-style license. 9 Which is provided under a BSD-style license.
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 size = len(arr) 81 size = len(arr)
82 if size < 2: 82 if size < 2:
83 return 1.0 83 return 1.0
84 else: 84 else:
85 return 1.0 - sum(x**3 - x for x in cnt) / float(size**3 - size) 85 return 1.0 - sum(x**3 - x for x in cnt) / float(size**3 - size)
86 86
87 87
88 def _NormSf(x): 88 def _NormSf(x):
89 """Survival function of the standard normal distribution. (1 - cdf)""" 89 """Survival function of the standard normal distribution. (1 - cdf)"""
90 return (1 - math.erf(x/math.sqrt(2))) / 2 90 return (1 - math.erf(x/math.sqrt(2))) / 2
OLDNEW
« no previous file with comments | « dashboard/dashboard/pinpoint/models/job.py ('k') | dashboard/dashboard/pinpoint/models/mann_whitney_u_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698