Skip to content

Commit

Permalink
update lstm
Browse files Browse the repository at this point in the history
  • Loading branch information
sunlanchang committed Jun 18, 2020
1 parent 40096fa commit 2edb478
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion LSTM_age_gender.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def scheduler(epoch):
val_examples = args.val_examples
mail('start train lstm')
if args.head_concat:
model.load_weights('tmp/lstm_epoch_05.hdf5')
# model.load_weights('tmp/lstm_epoch_05.hdf5')
model.fit(
{
'creative_id': DATA['X1_train'][:train_examples],
Expand Down Expand Up @@ -600,3 +600,15 @@ def scheduler(epoch):
# mail('predict lstm gender done')

# %%
def merge_age_gender_csv():
import pandas as pd
gender = pd.read_csv('data/ans/lstm_gender.csv')
age = pd.read_csv('data/ans/lstm_age.csv')
# %%
ans['predicted_gender'] = gender.predicted_gender
ans['predicted_age'] = age.predicted_age
ans.to_csv('data/ans/LSTM.csv', header=True, index=False,
columns=['user_id', 'predicted_age', 'predicted_gender'])
# %%
# mail('save ans to csv done!')
# %%

0 comments on commit 2edb478

Please sign in to comment.