Graphs.py 617 B

12345678910111213141516171819202122
  1. import matplotlib.pyplot as plt
  2. import pandas as pd
  3. df = pd.read_csv("./cnn_net_data.csv")
  4. # To Regraph ROC, run main.py without training
  5. # It will run validation sett and create it based on latest trained model
  6. # MAKES EPOCH VS AVG LOSS GRAPH
  7. plt.plot(df['Epoch'], df['Avg_loss'], label="Loss on Training")
  8. plt.xlabel('Epoch')
  9. plt.ylabel('Average Loss')
  10. plt.title('Loss vs Epoch On Training & Validation data')
  11. # MAKES EPOCH VS VALIDATION LOSS GRAPH
  12. plt.plot(df['Epoch'], df['Val_loss'], label="Loss on Validation")
  13. plt.savefig('./avgloss_epoch_curve.png')
  14. plt.legend()
  15. plt.show()
  16. # ACCURACY VS THRESHOLD GRAPH