The linear model does alright at its first attempt, but if we want our model to be more accurate, we will have to use a more complex model with some non-linearities in order to fit well to all the data points. XGBoost is the model we will be using in this section in order to try and improve the accuracy obtained through linear regression. This is done in the following manner:
- Import the XGBoost library using the import xgboost command.
- In case this produces an error, you will have to do a pip install of the library through the terminal. This can be done by opening up a new terminal window and issuing the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ...