Xgboost for Python in MacOS
For the record, I am using a Mac with OS X 10.10 (Yosemite). It took me a while to work through the various issues, but it is now running nicely in my Anaconda (Py36) environment.
For multi-threading you need to do the following first (install homebrew if you have not done so):
You might get some warnings to unlink directories or delete them if you have other versions installed; follow the warnings/instructions.
Next get the xgboost files from Github. I downloaded it to Anaconda/pkgs directory.
The next series of steps differ from the documentation on the xgboost site, and I cobbled it together from lots of sources and also experimenting. The problem is that some key lines in the make files are commented out and also not fully specified.
Now, use your favorite editor (I used vi), and go into the file that you copied from /make to /xgboost
Uncomment the lines near the top of the file:
Change them to the following:
It is possible that simply uncommenting the lines solves the problem. It did not for me; I needed to add the -6 to both lines. Save the file.
Also, make changes to the file xgboost/Makefile; change lines 47 and 50 to reflect the commands above. Again, I used vi for this editing.
Save the file and now you need to run a cleaning step since you changed the Makefile.
This should configure it cleanly and build the library. You still need to install it.
Now restart Python/Anaconda and you should be able to import the library.
Summary of Steps:
Enable the following 2 lines in the make/config.mk
$ conda install py-xgboost