Commit 3bc1226a authored by 张彦钊's avatar 张彦钊

readcsv tocsv 参数修改

parent 08b2055c
...@@ -41,9 +41,8 @@ def transform_ffm_format(df, device_id): ...@@ -41,9 +41,8 @@ def transform_ffm_format(df, device_id):
now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M") now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M")
predict_file_name = DIRECTORY_PATH + "result/{0}_{1}DiaryTop2000.csv".format(device_id, now) predict_file_name = DIRECTORY_PATH + "result/{0}_{1}DiaryTop2000.csv".format(device_id, now)
data.to_csv(predict_file_name) data.to_csv(predict_file_name, index=False,header=None)
user_instance_file_path = '' return predict_file_name
return user_instance_file_path
# 将模型加载,预测,把预测日记的概率值按照降序排序,存到一个表里 # 将模型加载,预测,把预测日记的概率值按照降序排序,存到一个表里
...@@ -73,7 +72,7 @@ def upload_predict(user_profile, instance): ...@@ -73,7 +72,7 @@ def upload_predict(user_profile, instance):
def wrapper_result(prob, device_id): def wrapper_result(prob, device_id):
prob = prob.head(500) prob = prob.head(500)
prob["url"] = prob["cid"].apply(lambda x: "http://m.igengmei.com/diary_book/" + prob[x.index('|') + 1:] + '/') prob["url"] = prob["cid"].apply(lambda x: "http://m.igengmei.com/diary_book/" + prob[x.index('|') + 1:] + '/')
prob.to_csv(DIRECTORY_PATH + "result/{}_feed".format(device_id)) prob.to_csv(DIRECTORY_PATH + "result/{}_feed".format(device_id),index= False)
def router(device_id): def router(device_id):
......
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