Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Trực quan hóa accuracy train/validation trên IMDB dataset với TensorFlow


TensorFlow (Google) framework học máy mã nguồn mở. Cài đặt: pip install tensorflow.

IMDB dataset: >50.000 review phim, dùng cho Xử lý Ngôn ngữ Tự nhiên (NLP).

Chạy trên Google Colab (Python trên trình duyệt, GPU miễn phí).

Ví dụ

plt.plot(epochs, acc, 'bo', label='Training acc')
plt.plot(epochs, val_acc, 'b', label='Validation acc')
plt.title('Training and validation accuracy')
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.legend(loc='lower right')
plt.show()

Nguồn mã: TensorFlow Text Classification

Đầu ra

Trực quan hóa accuracy train/validation trên IMDB dataset với TensorFlow

Giải thích

  • Sau khi fit dữ liệu, so sánh giá trị thực và dự đoán.
  • Trực quan hóa tốt nhất bằng matplotlib.
  • Vẽ accuracy train/validation theo số epoch.