We proceed with the recipe as follows:
- 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()
- 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 ...