Regression with Neural Networks

Regression from Numeric Data

Train a predictor that predicts the median value of properties in a neighborhood of Boston, given some features of the neighborhood.

First, obtain the training and validation data:
In[1]
Click for copyable input
In[2]
Click for copyable input
Out[2]
Define a net that returns a scalar:
In[3]
Click for copyable input
Out[3]
Train the net and return both the trained net and the lowest validation loss:
In[4]
Click for copyable input
Out[4]
Make a prediction:
In[5]
Click for copyable input
Out[5]
Train a predictor using Predict instead, and obtain the mean squared loss on the test set:
In[6]
Click for copyable input
Out[6]
Out[6]

Related Tutorials