Commit e6cb03df authored by 郭羽's avatar 郭羽

特征工程优化

parent c381dd18
...@@ -138,7 +138,7 @@ def train(emb_columns, number_columns, oneHot_columns, inputs, train_dataset): ...@@ -138,7 +138,7 @@ def train(emb_columns, number_columns, oneHot_columns, inputs, train_dataset):
# train the model # train the model
print("train start...") print("train start...")
model.fit(train_dataset, epochs=10) model.fit(train_dataset, epochs=5)
print("train end...") print("train end...")
print("train save...") print("train save...")
...@@ -177,10 +177,6 @@ def addDays(n, format="%Y%m%d"): ...@@ -177,10 +177,6 @@ def addDays(n, format="%Y%m%d"):
if __name__ == '__main__': if __name__ == '__main__':
isTest = False
if (len(sys.argv) >= 2 and "test" == sys.argv[1]):
isTest = True
curTime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) curTime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
print("train_service执行时间:{}".format(curTime)) print("train_service执行时间:{}".format(curTime))
splitTimestamp = int(time.mktime(time.strptime(addDays(-1), "%Y%m%d"))) splitTimestamp = int(time.mktime(time.strptime(addDays(-1), "%Y%m%d")))
...@@ -195,7 +191,6 @@ if __name__ == '__main__': ...@@ -195,7 +191,6 @@ if __name__ == '__main__':
print(df_train.dtypes) print(df_train.dtypes)
df_test = df_train.loc[df_train['timestamp']>=splitTimestamp] df_test = df_train.loc[df_train['timestamp']>=splitTimestamp]
if isTest:
df_train = df_train.loc[df_train['timestamp'] < splitTimestamp] df_train = df_train.loc[df_train['timestamp'] < splitTimestamp]
# df_test = loadData(data_path_test) # df_test = loadData(data_path_test)
timestmp2 = int(round(time.time())) timestmp2 = int(round(time.time()))
......
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