How to do it

We proceed with the recipe as follows:

  1. We start by loading the libraries and initializing our computational graph as follows:
import matplotlib.pyplot as plt 
import numpy as np 
import tensorflow as tf 
import requests 
sess = tf.Session() 
  1. Next, we load, extract, and normalize our data as in the preceding recipe, except that here we are going to using the low birth weight indicator variable as our target instead of the actual birth weight, shown as follows:
# Name of data filebirth_weight_file = 'birth_weight.csv'birthdata_url = 'https://github.com/nfmcclure/tensorflow_cookbook/raw/master' \                '/01_Introduction/07_Working_with_Data_Sources/birthweight_data/birthweight.dat'# Download data and create data file if file does not ...

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.