XGBoost predictive model settings and model training
Now, you are ready to do some training and check how well your model will predict housing value based on the eight input parameters. Just as in Chapter 2, you’ll train the model using the training dataset and test with the testing set, as you’d expect. In this section, you’ll do some model evaluation with built-in functions from Scikit-learn. This time, you’re performing regression rather than classification, so you won’t use a confusion matrix; instead, you will look at how well your model fits the data with metrics such as R2 and root mean square error (RMSE).
Let’s talk about these metrics for a second. When you fit a model to data, you want to be sure that your model accurately represents the training data and at the same time is flexible to provide accurate predictions for data that is not in the training dataset. R2 and RMSE measure how far the modeled values are from the actual...