Commit 248092b2 authored by 赵威's avatar 赵威

remove tractate device info

parent ad75bb56
......@@ -295,13 +295,13 @@ CATEGORICAL_COLUMNS = [
# "device_fp2",
# "device_sp2",
# "device_p2",
"device_fd3",
"device_sd3",
"device_fs3",
"device_ss3",
"device_fp3",
"device_sp3",
"device_p3",
# "device_fd3",
# "device_sd3",
# "device_fs3",
# "device_ss3",
# "device_fp3",
# "device_sp3",
# "device_p3",
]
CROSS_COLUMNS = [
["device_fd", "content_fd"],
......@@ -442,13 +442,13 @@ def join_features(device_df, tractate_df, cc_df):
# df["device_sp2"] = df["second_positions_x"].apply(lambda x: nth_element(x, 1))
# df["device_p2"] = df["projects_x"].apply(lambda x: nth_element(x, 1))
df["device_fd3"] = df["first_demands_x"].apply(lambda x: nth_element(x, 2))
df["device_sd3"] = df["second_demands_x"].apply(lambda x: nth_element(x, 2))
df["device_fs3"] = df["first_solutions_x"].apply(lambda x: nth_element(x, 2))
df["device_ss3"] = df["second_solutions_x"].apply(lambda x: nth_element(x, 2))
df["device_fp3"] = df["first_positions_x"].apply(lambda x: nth_element(x, 2))
df["device_sp3"] = df["second_positions_x"].apply(lambda x: nth_element(x, 2))
df["device_p3"] = df["projects_x"].apply(lambda x: nth_element(x, 2))
# df["device_fd3"] = df["first_demands_x"].apply(lambda x: nth_element(x, 2))
# df["device_sd3"] = df["second_demands_x"].apply(lambda x: nth_element(x, 2))
# df["device_fs3"] = df["first_solutions_x"].apply(lambda x: nth_element(x, 2))
# df["device_ss3"] = df["second_solutions_x"].apply(lambda x: nth_element(x, 2))
# df["device_fp3"] = df["first_positions_x"].apply(lambda x: nth_element(x, 2))
# df["device_sp3"] = df["second_positions_x"].apply(lambda x: nth_element(x, 2))
# df["device_p3"] = df["projects_x"].apply(lambda x: nth_element(x, 2))
df["content_fd"] = df["first_demands_y"].apply(lambda x: nth_element(x, 0))
df["content_sd"] = df["second_demands_y"].apply(lambda x: nth_element(x, 0))
......@@ -545,13 +545,13 @@ def device_tractate_fe(device_id, tractate_ids, device_dict, tractate_dict):
# device_info["device_fp2"] = nth_element(device_fp, 1)
# device_info["device_sp2"] = nth_element(device_sp, 1)
# device_info["device_p2"] = nth_element(device_p, 1)
device_info["device_fd3"] = nth_element(device_fd, 2)
device_info["device_sd3"] = nth_element(device_sd, 2)
device_info["device_fs3"] = nth_element(device_fs, 2)
device_info["device_ss3"] = nth_element(device_ss, 2)
device_info["device_fp3"] = nth_element(device_fp, 2)
device_info["device_sp3"] = nth_element(device_sp, 2)
device_info["device_p3"] = nth_element(device_p, 2)
# device_info["device_fd3"] = nth_element(device_fd, 2)
# device_info["device_sd3"] = nth_element(device_sd, 2)
# device_info["device_fs3"] = nth_element(device_fs, 2)
# device_info["device_ss3"] = nth_element(device_ss, 2)
# device_info["device_fp3"] = nth_element(device_fp, 2)
# device_info["device_sp3"] = nth_element(device_sp, 2)
# device_info["device_p3"] = nth_element(device_p, 2)
tractate_lst = []
tractate_ids_res = []
for id in tractate_ids:
......
......@@ -174,13 +174,13 @@ _categorical_columns = [
# "device_fp2",
# "device_sp2",
# "device_p2",
"device_fd3",
"device_sd3",
"device_fs3",
"device_ss3",
"device_fp3",
"device_sp3",
"device_p3",
# "device_fd3",
# "device_sd3",
# "device_fs3",
# "device_ss3",
# "device_fp3",
# "device_sp3",
# "device_p3",
]
PREDICTION_ALL_COLUMNS = _int_columns + _float_columns + _categorical_columns
......
......@@ -62,8 +62,7 @@ def main():
estimator_config = tf.estimator.RunConfig(session_config=session_config)
model = tf.estimator.Estimator(model_fn=esmm_model_fn, params=params, model_dir=model_path, config=estimator_config)
# TODO 50000
train_spec = tf.estimator.TrainSpec(input_fn=lambda: esmm_input_fn(train_df, shuffle=True), max_steps=15000)
train_spec = tf.estimator.TrainSpec(input_fn=lambda: esmm_input_fn(train_df, shuffle=True), max_steps=50000)
eval_spec = tf.estimator.EvalSpec(input_fn=lambda: esmm_input_fn(val_df, shuffle=False))
res = tf.estimator.train_and_evaluate(model, train_spec, eval_spec)
print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
......@@ -78,9 +77,8 @@ def main():
model_export_path = str(Path("/data/files/models/tractate/").expanduser())
save_path = model_export(model, all_features, model_export_path)
print("save to: " + save_path)
# TODO save model
# set_essm_model_save_path("tractate", save_path)
# record_esmm_auc_to_db("tractate", ctr_auc, ctcvr_auc, total_time, save_path)
set_essm_model_save_path("tractate", save_path)
record_esmm_auc_to_db("tractate", ctr_auc, ctcvr_auc, total_time, save_path)
print("============================================================")
# save_path = get_essm_model_save_path("tractate")
......
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