r80244 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80243‎ | r80244 | r80245 >
Date:09:56, 14 January 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
cleaned up confidence plotting.
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/compute_confidence.py (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/compute_confidence.py
@@ -221,6 +221,7 @@
222222 means_2 = ret[1]
223223 std_devs_1 = ret[2]
224224 std_devs_2 = ret[3]
 225+ confidence = ret[4]
225226
226227 #print means_1
227228 #print means_2
@@ -233,8 +234,7 @@
234235 subplot_index = 111
235236 fname = test_name + '.png'
236237
237 - title = query_obj.get_plot_title(test_name)
238 - title = title + ' -- ' + start_time + ' - ' + end_time
 238+ title = confidence + '\n\n' + test_name + ' -- ' + start_time + ' - ' + end_time
239239
240240 max_mean = max(max(means_1),max(means_2))
241241 max_sd = max(max(std_devs_1),max(std_devs_2))
@@ -243,7 +243,7 @@
244244 max_x = float(math.ceil(max(times_indices))) + 1.0
245245 ranges = [-0.5, max_x, 0, max_y]
246246
247 - ylabel = query_obj.get_plot_ylabel(metric_name)
 247+ ylabel = metric_name
248248 self.gen_plot(means_1, means_2, std_devs_1, std_devs_2, times_indices, title, xlabel, ylabel, ranges, subplot_index, fname)
249249
250250 return
@@ -321,50 +321,50 @@
322322
323323 # determine the probability that the
324324 if (W >= 1.9):
325 - print '95% confident about the winner.'
 325+ conf_str = '95% confident about the winner.'
326326 P = 0.95
327327 elif (W >= 1.6):
328 - print '89% confident about the winner.'
 328+ conf_str = '89% confident about the winner.'
329329 P = 0.89
330330 elif (W >= 1.3):
331 - print '81% confident about the winner.'
 331+ conf_str = '81% confident about the winner.'
332332 P = 0.81
333333 elif (W >= 1.0):
334 - print '73% confident about the winner.'
 334+ conf_str = '73% confident about the winner.'
335335 P = 0.73
336336 elif (W >= 0.9):
337 - print '68% confident about the winner.'
 337+ conf_str = '68% confident about the winner.'
338338 P = 0.68
339339 elif (W >= 0.8):
340 - print '63% confident about the winner.'
 340+ conf_str = '63% confident about the winner.'
341341 P = 0.63
342342 elif (W >= 0.7):
343 - print '52% confident about the winner.'
 343+ conf_str = '52% confident about the winner.'
344344 P = 0.52
345345 elif (W >= 0.6):
346 - print '45% confident about the winner.'
 346+ conf_str = '45% confident about the winner.'
347347 P = 0.45
348348 elif (W >= 0.5):
349 - print '38% confident about the winner.'
 349+ conf_str = '38% confident about the winner.'
350350 P = 0.38
351351 elif (W >= 0.4):
352 - print '31% confident about the winner.'
 352+ conf_str = '31% confident about the winner.'
353353 P = 0.31
354354 elif (W >= 0.3):
355 - print '24% confident about the winner.'
 355+ conf_str = '24% confident about the winner.'
356356 P = 0.24
357357 elif (W >= 0.2):
358 - print '16% confident about the winner.'
 358+ conf_str = '16% confident about the winner.'
359359 P = 0.16
360360 elif (W >= 0.1):
361 - print '8% confident about the winner.'
 361+ conf_str = '8% confident about the winner.'
362362 P = 0.08
363363 else:
364 - print 'There is no clear winner.'
 364+ conf_str = 'There is no clear winner.'
365365 P = 0.08
366366
367367
368 - return [means_1, means_2, std_devs_1, std_devs_2]
 368+ return [means_1, means_2, std_devs_1, std_devs_2, conf_str]
369369
370370
371371 """

Status & tagging log