Commit eaf728d4 authored by 高雅喆's avatar 高雅喆

Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline

fix bug in eda/test/getTopFeatures.py with a positional args
parents 36261559 e598c182
...@@ -94,14 +94,12 @@ if __name__ == "__main__": ...@@ -94,14 +94,12 @@ if __name__ == "__main__":
start = time.time() start = time.time()
empty,device_id_list = get_active_users() empty,device_id_list = get_active_users()
if empty: if empty:
print("当前没有活跃用户,不需要预测")
time.sleep(60) time.sleep(60)
else: else:
for device_id in device_id_list: for device_id in device_id_list:
router(device_id) router(device_id)
end = time.time() end = time.time()
# 将秒转化为毫秒 time_cost = (end - start)
time_cost = (end - start)*1000 print("预测耗时{}秒".format(time_cost))
print("预测耗时{}毫秒".format(time_cost))
...@@ -11,7 +11,7 @@ def get_active_users(): ...@@ -11,7 +11,7 @@ def get_active_users():
"where active_time <= '{}' and active_time >= '{}'".format(now_end,now_start) "where active_time <= '{}' and active_time >= '{}'".format(now_end,now_start)
device_id_df = con_sql(sql) device_id_df = con_sql(sql)
if device_id_df.empty: if device_id_df.empty:
print("当下这一分钟没有活跃用户") print("当下这一分钟没有活跃用户,不需要预测")
return True,None return True,None
else: else:
device_id_list = device_id_df[0].values.tolist() device_id_list = device_id_df[0].values.tolist()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment