Installing XGBoost

xgboost.png

xgboost is a very popular machine learning library and widely used (for example on kaggle). However, contrary to a lot of other popular libraries it can not be easily installed with conda or pip. You have to compile the library first. The installation guide can be found here. This blog post is a short version of the installation guide and mainly targeted for myself for reference.

Installation on Windows

  • Clone the recent git: https://github.com/dmlc/xgboost
  • Download the current library here
  • cd into the folder %path to xgboost git%/python-package
  • activate the correct conda environment (in my case activate ml)
  • execute python setup.py install
  • Test the installation by entering python
    • enter import xgboost

Installation on OSX

  • Clone the recent git: https://github.com/dmlc/xgboost
    • use git clone --recursive https://github.com/dmlc/xgboost
  • Install the OSX Developer Command line tools
    • xcode-select --install
  • Navigate to the git repository
    • usually by calling cd xgboost
  • Enter the following commands in the terminal
    • cp make/minimum.mk ./config.mk
    • make -j4
  • Navigate into the python-package folder
  • activate the correct conda environment (in my case source activate ml)
  • call sudo python setup.py install
  • test the installation by entering python
    • enter import xgboost