Commit 6a65f4ae authored by 张彦钊's avatar 张彦钊

fix datetime bug

parent b1515605
......@@ -7,9 +7,6 @@ import time
from utils import *
# 接收device_id、city_id
# 将device_id、city_id拼接到对应的城市热门日记表。注意:下面预测集特征顺序要与训练集保持一致
def feature_en(user_profile):
file_name = DIRECTORY_PATH + "diaryTestSet/{0}DiaryTop3000.csv".format(user_profile['city_id'])
......@@ -17,7 +14,7 @@ def feature_en(user_profile):
data["device_id"] = user_profile['device_id']
now = datetime.datetime.now()
now = datetime.now()
data["hour"] = now.hour
data["minute"] = now.minute
......@@ -39,7 +36,7 @@ def transform_ffm_format(df, device_id):
with open(file_path, "rb") as f:
ffm_format_pandas = pickle.load(f)
data = ffm_format_pandas.transform(df)
now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M")
now = datetime.now().strftime("%Y-%m-%d-%H-%M")
predict_file_name = DIRECTORY_PATH + "result/{0}_{1}DiaryTop2000.csv".format(device_id, now)
data.to_csv(predict_file_name, index=False,header=None)
......
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