We proceed with the recipe as follows:
- First, we load the necessary libraries and initialize a graph, as follows:
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from sklearn import datasets sess = tf.Session()
- Now, we load the data. This time, each element of x data will be a list of three values instead of one. Use the following code:
iris = datasets.load_iris() x_vals = np.array([[x[1], x[2], x[3]] for x in iris.data]) y_vals = np.array([y[0] for y in iris.data])
- Next, we declare the batch size, placeholders, variables, and model output. The only difference here is that we change the size specifications of the x data placeholder to take three values instead of one, as follows:
batch_size ...