March 2019
Intermediate to advanced
196 pages
4h 50m
English
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 tffrom sklearn.datasets import load_bostonfrom sklearn.preprocessing import scaleimport numpy as np
And our important constants are shown as follows:
learning_rate = 0.01epochs = 10000display_epoch = epochs//20n_train = 300n_valid = 100
Next, we load our dataset and split it into training, validation, and ...
Read now
Unlock full access