In this section, we'll complete the steps required before creating a predictive neural network and then we will create the neural network itself:
- We begin by importing the necessary modules to the project:
import matplotlib.pyplot as plt%matplotlib inlineimport numpy as npfrom sklearn.datasets import fetch_openmlimport randomimport cntk.tests.test_utilsfrom sklearn.preprocessing import OneHotEncoderimport cntk as C # if you have not done this before in the project
The fetch_openml() method of the sklearn modules helps us directly download the dataset used in this example to the project—the MNIST Handwritten Digits dataset. The OneHotEncoder method is used for the one-hot encoding of the labels.
- Next ...