Commit 148393ea authored by 张彦钊's avatar 张彦钊

regroup get_active_users,add some prints

parent 4adad597
......@@ -25,8 +25,8 @@ def feature_en(user_profile):
# 虽然预测y,但ffm转化需要y,并不影响预测结果
data["y"] = 0
data = data.drop("city_id", axis=1)
print(data.head(2))
print(data.head(1))
print("特征工程处理结束")
return data
......@@ -37,7 +37,7 @@ def transform_ffm_format(df, device_id):
ffm_format_pandas = pickle.load(f)
data = ffm_format_pandas.transform(df)
now = datetime.now().strftime("%Y-%m-%d-%H-%M")
print("ffm格式转化结束")
predict_file_name = DIRECTORY_PATH + "result/{0}_{1}DiaryTop2000.csv".format(device_id, now)
data.to_csv(predict_file_name, index=False,header=None)
return predict_file_name
......
......@@ -27,7 +27,7 @@ def fetch_user_profile(device_id):
if user_profile.empty:
print("没有获取到该用户对应的city_id")
return {}, user_profile.empty
else:
user_profile = user_profile.rename(columns={0:"device_id",1:"city_id"})
print("成功获取该用户对应的city_id")
user_profile_dict = {}
......
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