Commit 584f0116 authored by 高雅喆's avatar 高雅喆

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

add a README.md and fix start.sh with a cat command to merge all files
parents 9e123f30 ecf57273
......@@ -45,8 +45,9 @@ def get_eachCityDiaryTop2000():
cityList = get_cityList()
allCitiesTop2000 = get_allCitiesDiaryTop2000()
for i in cityList:
sql = "select '{0}',cid from data_feed_click " \
"where cid_type = 'diary' group by cid order by max(click_count_choice) desc limit 2000".format(i)
sql = "select city_id,cid from data_feed_click " \
"where cid_type = 'diary' and city_id = '{0}' group by cid " \
"order by max(click_count_choice) desc limit 2000".format(i)
data = con_sql(sql)
data = data.rename(columns={0: "city_id", 1: "cid"})
data = filter_cid(data)
......
......@@ -73,7 +73,7 @@ def upload_predict(user_profile, instance):
def wrapper_result(prob, device_id):
prob = prob.head(500)
prob.loc[:,"url"] = prob["cid"].apply(lambda x: "http://m.igengmei.com/diary_book/" + str(x[6:]) + '/')
prob.to_csv(DIRECTORY_PATH + "result/{}_feed".format(device_id),index= False)
prob.to_csv(DIRECTORY_PATH + "result/feed_{}".format(device_id),index= False)
def router(device_id):
......@@ -86,4 +86,4 @@ def router(device_id):
if __name__ == "__main__":
router(device_id='358035085192742')
router(device_id='EDEE004A-40AC-4ACD-9D3F-D54480EACEE9')
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