Commit 8203ecd7 authored by 张彦钊's avatar 张彦钊

从获取所有的数据改为获取一天的数据

parent 55f77c05
File added
......@@ -15,18 +15,18 @@ def con_sql(sql):
return df
# 获取点击表里的device_id
sql = "select distinct device_id from data_feed_click where cid_type = 'diary'"
sql = "select distinct device_id from data_feed_click"
click_device_id = con_sql(sql)[0].values.tolist()
print("成功获取点击表里的device_id")
# 获取点击表里的数据
sql = "select cid,device_id,time from data_feed_click where cid_type = 'diary'"
sql = "select cid,device_id,time from data_feed_click where where stat_date = '2018-07-30'"
click = con_sql(sql)
click = click.rename(columns={0:"cid",1:"device_id",2:"time"})
print("成功获取点击表里的数据")
# 获取曝光表里的数据
sql = "select cid,device_id,time from data_feed_exposure where cid_type = 'diary'"
sql = "select cid,device_id,time from data_feed_exposure where stat_date = '2018-07-30'"
exposure = con_sql(sql)
exposure = exposure.rename(columns={0:"cid",1:"device_id",2:"time"})
print("成功获取曝光表里的数据")
......@@ -149,15 +149,3 @@ ffm_model.setSigmoid()
ffm_model.predict("/home/zhangyanzhao/model.out", "/home/zhangyanzhao/output.txt")
print("end")
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