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
  • 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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s