فهرست منبع

开发阅读均值置信度上界代码

luojunhui 3 روز پیش
والد
کامیت
284d3a7984
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 3 0
      applications/const/__init__.py
  2. 1 1
      updateAccountV3.py

+ 3 - 0
applications/const/__init__.py

@@ -150,6 +150,9 @@ class UpdateAccountReadAvgTaskConst:
     # 统计周期
     STAT_PERIOD = 30
 
+    # default upper_quantile, confidence = 0.95
+    DEFAULT_UPPER_QUANTILE = 0.975
+
 
 class WeixinVideoCrawlerConst:
     """

+ 1 - 1
updateAccountV3.py

@@ -80,7 +80,7 @@ class UpdateAccountInfoVersion3(object):
         mean = np.mean(read_avg_list)
         std = np.std(read_avg_list, ddof=1)
         se = std / np.sqrt(n)
-        t = stats.t.ppf(0.975, df=n - 1)
+        t = stats.t.ppf(const.DEFAULT_UPPER_QUANTILE, df=n - 1)
         upper_t = mean + t * se
         return upper_t