- Hands-On Neural Networks with Keras
- Niloy Purkait
- 163字
- 2025-04-04 14:37:33
Plotting training and test errors
In the following graph, we can see that the average error is about 2.5 (or $2,500 dollars). While this may be a small variance when predicting the prices on houses that cost $50,000, it starts to matter if the house itself costs $5,000:

Finally, let's predict some housing prices using data from the test set. We will use a scatter plot to plot the predictions and actual labels of our test set. In the following graph, we can see a line of best fit, along with the data points. Our model seems to capture the general trend in our data, despite having some outlandish predictions for some points:

Moreover, we can plot a histogram that shows the distribution of our prediction errors. It appears that our model seems to do pretty well on most counts, but has some trouble predicting certain values, while overshooting and undershooting for a small number of observations, as shown in the following diagram:
