I Knew You Were TROUBLE (Xgboost + Python + Windows) : A Proper Guide

So yeah, Xgboost + Python + Windows is an invitation to a trouble. That is if you don’t do the build and installation properly!

So let’s get everything unwrapped CORRECTLY! First, I am using following versions.
xgboost: 0.4
python: 3.5.0
Windows 8: 64-bit
Microsoft Visual Studio C++: 2013

1. First, clone xgboost with submodules
git clone <repo_url> --recursive

2. Revert to the correct release (0.4)
git checkout <commit_id>

3. Open MSVS (Visual Studio), and the project. It should be located at

4. Now your “Solution Explorer” should look like this
MSVS Solution Explorer

5. Set the properties. Open “Project Properties” from the main menu (Project -> Properties). Then from that, open “Configuration Manager”. Then set all the projects to “Release” and “x64” as in the image.
Configuration Manager

6. Now you’re ready to go. Cross your fingers and choose “Build Solution” from the build menu. If everything goes well, you should be able to see something like in this log file in the output console

7. Go to <repo_root>\windows\. Inside, there should be a folder x64\Release. You will find all the built files in there. Namely, they should be,

  • rabit.lib
  • xgboost.exe
  • xgboost.pdb
  • xgboost_wrapper.dll
  • xgboost_wrapper.exp
  • xgboost_wrappe.libr
  • xgboost_wrapper.pdb

8. Copy all of this to <repo_root>\wrapper\ (If this doesn’t exist, check if <repo_root>\python-packages\xgboost exists)

9. Run python setup.py install

10. This should be it. You might have to add xgboost to the project depending on your IDE. To make sure everything went well, check if <anaconda_root>\lib\site-packages\xgboost exists (if using Anaconda).

Potential issues:
[Error 193] %1 is not a valid Win32 app
If you’re getting this error, you probably used “Win32” for platform. Try it with “x64”

unimplemented: 64-bit mode not compiled in
Using make tools such as Cygwin64 didn’t work form me. I kept getting the above error

Several resources that helped me
[1] https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13043/run-xgboost-from-windows-and-python
[2] http://xgboost.readthedocs.org/en/latest/build.html

Light on Math Machine Learning: Intuitive Guide to Understanding KL Divergence

I’m starting a new series of blog articles following a beginner friendly approach to understanding some of the challenging concepts in machine learning. To start with, we will start with KL divergence. Code: Here Concept Grounding First of all let us build some ground rules. We will define few things...

Walkthrough: Working with Tensorflow on Windows through Docker

Versions of the dependencies in the tutorial Python: 2.7 Tensorflow: 0.11.0rc2 Docker: 1.12.2 Windows: 8 (64-bit) If you have looked at Tensorflow not much guidance exist for getting it to work in Windows. This page includes installation instructions for Tensorflow (instructions). But not so much for Windows. In fact, the...