prf_val, df_val = eval_plot.evaluate_dbm(model_RNN, data, 'val_ids') df_all = pd.concat([df_tr, df_val, df_test], axis=1) dict_df_prf_mod['Epoch' + str(iter_)] = df_all print('==' * 5 + "Epoch No:" + str(iter_) + "==" * 5) print("Training Loss: " + str(total_loss)) print("==" * 4) print("Train: " + str(prf_tr)) print(df_tr) print("--" * 4) print("Val: " + str(prf_val)) print(df_val) print("--" * 4) print("Test: " + str(prf_test)) print(df_test) print('==' * 40) print('\n') if (save_flag): torch.save(model_RNN, './student_life/models/' + model_name + str(iter_) + '.pt') pickle.dump( dict_df_prf_mod, open( './student_life/results/dict_prf_' + model_name + str(iter_) + '.pkl', 'wb')) eval_plot.plot_graphs( dict_df_prf_mod, 'F-score', './student_life/plots/' + model_name + str(iter_) + '.png', 0, iter_ + 1, model_name)
print "=="*4 print "Train: " + str(prf_tr) print df_tr print "--"*4 print "Val: " + str(prf_val) print df_val print "--"*4 print "Test: " + str(prf_test) print df_test print '=='*40 print '\n' if(save_flag): torch.save(model_RNN, '../../Models/'+model_name+str(iter_)+'.pt') pickle.dump(dict_df_prf_mod, open('../../Results/dict_prf_'+model_name+str(iter_)+'.pkl','wb')) eval_plot.plot_graphs(dict_df_prf_mod, 'F-score', '../../Plots/'+model_name+str(iter_)+'.png', 0, iter_+1, model_name) # In[9]: eval_plot.plot_graphs(dict_df_prf_mod, 'F-score', '../../Plots/'+model_name+str(iter_)+'.png', 0, iter_, model_name) # In[ ]:
print('==' * 5 + "Epoch No:" + str(iter_) + "==" * 5) print("Training Loss: " + str(total_loss)) print("==" * 4) print("Train: " + str(prf_tr)) print(df_tr) print("--" * 4) print("Val: " + str(prf_val)) print(df_val) print("--" * 4) print("Test: " + str(prf_test)) print(df_test) print('==' * 40) print('\n') if (save_flag): torch.save(model, savepath + "/Models/" + model_name + str(iter_) + '.pt') pickle.dump( dict_df_prf_mod, open( savepath + '/Results/dict_prf_' + model_name + str(iter_) + '.pkl', 'wb')) # eval_plot.plot_graphs(dict_df_prf_mod, 'F-score', savepath+'/Plots/'+model_name+str(iter_)+'.png', 0, iter_+1, model_name) eval_plot.plot_graphs(dict_df_prf_mod, 'F-score', savepath + '/Plots/' + model_name + str(iter_) + '.png', 0, iter_, model_name) # f.close()