Commit 847e44b0 authored by 赵威's avatar 赵威

update field

parent e7ac5319
......@@ -19,20 +19,18 @@ from models.esmm.model import esmm_model_fn, model_export, model_predict
def main():
time_begin = time.time()
# df = get_device_df_from_redis()
df2 = get_diary_df_from_redis()
print(df2.sample(1))
print(df2.columns)
# df2 = get_diary_df_from_redis()
# print(df2.sample(1))
# print(df.size)
# print(df2.size)
# a = device_feature_engineering(df)
b = diary_feature_engineering(df2)
# print(a.size)
print(b.sample(1))
# b = diary_feature_engineering(df2)
# print(b.sample(1))
device_df, diary_df, click_df, conversion_df = read_csv_data(Path("~/data/cvr_data/"))
print(diary_df.sample(1))
print(diary_df.columns)
# device_df = device_feature_engineering(device_df)
diary_df = diary_feature_engineering(diary_df)
print(diary_df.sample(1))
......
......@@ -86,9 +86,9 @@ def diary_feature_engineering(df):
diary_df["second_positions"] = diary_df["second_positions"].apply(lambda d: d if isinstance(d, list) else [])
diary_df["projects"] = diary_df["projects"].apply(lambda d: d if isinstance(d, list) else [])
diary_df["is_pure_author"] = diary_df["is_pure_author"].map(str_bool_map)
diary_df["is_have_pure_reply"] = diary_df["is_have_pure_reply"].map(str_bool_map)
diary_df["is_have_reply"] = diary_df["is_have_reply"].map(str_bool_map)
# diary_df["is_pure_author"] = diary_df["is_pure_author"].map(str_bool_map)
# diary_df["is_have_pure_reply"] = diary_df["is_have_pure_reply"].map(str_bool_map)
# diary_df["is_have_reply"] = diary_df["is_have_reply"].map(str_bool_map)
diary_df["is_pure_author"] = diary_df["is_pure_author"].astype(int)
diary_df["is_have_pure_reply"] = diary_df["is_have_pure_reply"].astype(int)
......
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