Project one – predicting the fuel efficiency of a car
So far, in this chapter, we have mostly focused on the torch.nn
module. We used nn.Sequential
to construct the models for simplicity. Then, we made model building more flexible with nn.Module
and implemented feedforward NNs, to which we added customized layers. In this section, we will work on a real-world project of predicting the fuel efficiency of a car in miles per gallon (MPG). We will cover the underlying steps in machine learning tasks, such as data preprocessing, feature engineering, training, prediction (inference), and evaluation.
Working with feature columns
In machine learning and deep learning applications, we can encounter various different types of features: continuous, unordered categorical (nominal), and ordered categorical (ordinal). You will recall that in Chapter 4, Building Good Training Datasets – Data Preprocessing, we covered different types of features and learned how to handle each...