From the course: Machine Learning and AI Foundations: Value Estimations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Predict values for new data

Predict values for new data

From the course: Machine Learning and AI Foundations: Value Estimations

Start my 1-month free trial

Predict values for new data

- [Instructor] Now that we have trained and tested our model, let's use it. Let's open up make_predictions.py. You'll notice as we go through this example, there are only a few lines of actual code even though this file contains all the logic needed to estimate the value of a house. That's because all the logic was created by the machine learning algorithm and saved in our model. We only need to load the model, pass in house data, and run it. First, let's load the gradient boosting model that we trained earlier. We just call joblib.load and pass in the file name. Next we have a list of all the attributes for the specific house that we want to value. We need to create an array with the same features in the exact same order as the training data that we used to train our model. That means the data here needs to reflect any feature engineering changes we made. So the fields we removed and the fields we added with one hot encoding are reflected here. I've already gone ahead and defined all…

Contents