First, we will show how to evaluate the simple regression model that simply fits a constant multiplication to the target, which is 10, as follows:
- First, we start by loading the libraries and creating the graph, data, variables, and placeholders. There is an additional part to this section that is very important. After we create the data, we will split the data into training and test datasets randomly. This is important because we will always test our models to see whether they are predicting well or not. Evaluating the model both on the training data and test data also lets us see whether the model is overfitting or not:
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf sess = tf.Session() x_vals ...