Chapter 11
2.8 Baseline model for car price prediction project
2.8 Baseline model for car price prediction project
![]()
Notes
- In this lesson we build a baseline model and apply the
df_traindataset to derive weights for the bias (w0) and the features (w). For this, we use thetrain_linear_regression(X, y)function from the previous lesson. - Linear regression only applies to numerical features. Therefore, only the numerical features from
df_trainare used for the feature matrix. - We notice some of the features in
df_trainarenan. We set them to0for the sake of simplicity, so the model is solvable, but it will be appropriate if a non-zeo value is used as the filler (e.g. mean value of the feature). - Once the weights are calculated, then we apply them on to derive the predicted y vector.
- Then we plot both predicted y and the actual y on the same histogram for a visual comparison.
The entire code of this project is available in this jupyter notebook.
