커뮤니티
Python
제목:    시각화
  1685   김윤중
  • 시각화 강의자료
  • matplotlib
  • twin graph
    • #학습과정의 loss화 accuracy의 변화 추이 분석
      import matplotlib.pyplot as plt
      fig, loss_ax = plt.subplots()
      acc_ax = loss_ax.twinx()

      loss_ax.plot(hist.history['loss'], 'y', label='train loss')
      loss_ax.plot(hist.history['val_loss'], 'r', label='val loss')
      loss_ax.set_xlabel('epoch');     loss_ax.set_ylabel('loss')
      loss_ax.legend(loc='upper left')

      acc_ax.plot(hist.history['accuracy'], 'b', label='train acc')
      acc_ax.plot(hist.history['val_accuracy'], 'g', label='val acc')
      acc_ax.set_ylabel('accuracy')
      cc_ax.legend(loc='upper right')
      plt.show()