How to do it...

We proceed with the recipe as follows:

  1. We will start by loading the libraries and initializing our computational graph as follows:
import tensorflow as tf 
import matplotlib.pyplot as plt import osimport csv
import requests 
import numpy as np 
sess = tf.Session() 
  1. We'll now load the data from the website using the requests module. After this, we will split the data into features of interest and the target value, 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 exist in current directory ...

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.