Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Matplotlib for Python Developers. - Second Edition

You're reading from  Matplotlib for Python Developers. - Second Edition

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788625173
Pages 300 pages
Edition 2nd Edition
Languages
Authors (3):
Aldrin Yim Aldrin Yim
Profile icon Aldrin Yim
Claire Chung Claire Chung
Profile icon Claire Chung
Allen Yu Allen Yu
Profile icon Allen Yu
View More author details

Table of Contents (16) Chapters

Title Page
Dedication
Packt Upsell
Contributors
Preface
Introduction to Matplotlib Getting Started with Matplotlib Decorating Graphs with Plot Styles and Types Advanced Matplotlib Embedding Matplotlib in GTK+3 Embedding Matplotlib in Qt 5 Embedding Matplotlib in wxWidgets Using wxPython Integrating Matplotlib with Web Applications Matplotlib in the Real World Integrating Data Visualization into the Workflow Index

Creating a CNN to recognize digits


In the following section, we will use Keras. Keras is a Python library for neural networks and provides a high-level interface to TensorFlow libraries. We do not intend to give a complete tutorial on Keras or CNN, but we want to show how we can use Matplotlib to visualize the loss function, accuracy, and outliers of the results. 

Readers who are not familiar with machine learning should be able to go through the logic of the remaining chapter and hopefully understand why visualizing the loss function, accuracy, and outliers of the results is important in fine-tuning the CNN model. 

Here is a snippet of code for the CNN; the most important part is the evaluation section after this!

# Import sklearn models for preprocessing input data
from sklearn.model_selection import train_test_split 
from sklearn.preprocessing import LabelBinarizer

# Import the necessary Keras libraries
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}