April 2017
Beginner to intermediate
358 pages
9h 30m
English
Using the functions we have already defined, we can now create a dataset of letters, each with different shear values. From this, we will train a neural network to recognize each letter from the image.
We first set up our random state and an array that holds the options for letters, shear values and scale values that we will randomly select from. There isn't much surprise here, but if you haven't used NumPy's arange function before, it is similar to Python's range function—except this one works with NumPy arrays and allows the step to be a float. The code is as follows:
from sklearn.utils import check_random_staterandom_state = check_random_state(14) letters = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") shear_values = ...Read now
Unlock full access