How to do it...

We will proceed with the recipe as follows: 

  1. We will start by loading the necessary libraries:
import random 
import string 
import numpy as np 
import tensorflow as tf 
  1. We will now create the reference dataset. To show succinct output, we will only make each dataset be comprised of 10 addresses (but it can be run with many more):
n = 10 street_names = ['abbey', 'baker', 'canal', 'donner', 'elm']street_types = ['rd', 'st', 'ln', 'pass', 'ave'] rand_zips = [random.randint(65000,65999) for i in range(5)] numbers = [random.randint(1, 9999) for i in range(n)] streets = [random.choice(street_names) for i in range(n)] street_suffs = [random.choice(street_types) for i in range(n)] zips = [random.choice(rand_zips) for i in range(n)] ...

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.