Commit bdf1d949 authored by 赵威's avatar 赵威

update field

parent 3e4d06d5
......@@ -30,7 +30,7 @@ def main():
print(b.size)
device_df, diary_df, click_df, conversion_df = read_csv_data(Path("~/data/cvr_data/"))
device_df = device_feature_engineering(device_df)
# device_df = device_feature_engineering(device_df)
diary_df = diary_feature_engineering(diary_df)
print(diary_df.sample(1))
# cc_df = click_feature_engineering(click_df, conversion_df)
......
......@@ -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"].replace(str_bool_map)
diary_df["is_have_pure_reply"] = diary_df["is_have_pure_reply"].replace(str_bool_map)
diary_df["is_have_reply"] = diary_df["is_have_reply"].replace(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