Commit 9b42092b authored by Bannier Delphine's avatar Bannier Delphine
Browse files

add nb + plot history model

parent 0fc9273d
This diff is collapsed.
This diff is collapsed.
import matplotlib.pyplot as plt
def plot_history(hist):
'''
`hist`: returned by model.fit()
'''
liste = list(hist.history.keys())
metrics = [i for i in liste if 'val' not in i]
for metric in metrics:
plt.plot(hist.history[f'{metric}'])
plt.plot(hist.history[f'val_{metric}'])
plt.title(f'model {metric}')
plt.ylabel(f'{metric}')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()
\ No newline at end of file
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