O'Reilly logo

Apache Spark Deep Learning Cookbook by Amrith Ravindra, Ahmed Sherif

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

There's more...

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:

  1. Import the XGBoost library using the import xgboost command.
  2. 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)" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required