인공지능
인공지능 : 인공지능 차트 보는 코드
하늘.98
2021. 12. 28. 17:51
def learning_curve(history, epoch):
plt.figure(figsize=(10,5))
# 정확도 차트
epoch_range = np.arange(1, epoch + 1)
plt.subplot(1, 2, 1)
plt.plot(epoch_range, history.history['accuracy'])
plt.plot(epoch_range, history.history['val_accuracy'])
plt.title('Model Accuracy')
plt.xlabel('Epoch')
plt.ylabel("Accurach")
plt.legend( ['Train', 'Val'] )
# plt.show()
# loss 차트
plt.subplot(1, 2, 2)
plt.plot(epoch_range, history.history['loss'])
plt.plot(epoch_range, history.history['val_loss'])
plt.title('Model Loss')
plt.xlabel('Epoch')
plt.ylabel("Loss")
plt.legend( ['Train', 'Val'] )
plt.show()
learning_curve(epoch_history, 50)