Next, we will apply a similar regression technique to the Boston housing dataset.
The main difference between this and our previous artificial dataset, which had just one feature, is that the Boston housing dataset is real data and has 13 features. This is a regression problem because house prices—the label—we take as being continuously valued.
Again, we start with our imports, as follows:
import tensorflow as tf
from sklearn.datasets import load_boston
from sklearn.preprocessing import scale
import numpy as np
And our important constants are shown as follows:
learning_rate = 0.01
epochs = 10000
display_epoch = epochs//20
n_train = 300
n_valid = 100
Next, we load our dataset and split it into training, validation, and test sets. We train on the training set, and check and fine-tune our trained model on the validation set, to make sure we have...