xgboostをWin10にインストールする手順をメモしておきます。
Cコンパイラでmakeしないとインストールできないようで、Windows環境だとちょっと面倒です。
以下の手順そのままです
https://www.kaggle.com/questions-and-answers/31960
試行環境
Windows10
python 3.6
手順
- git をインストールする
- winMW をインストールする
- gitでcloneしてコンパイルする
1. git をインストールする
git bash がない場合は以下からダウンロードします
https://gitforwindows.org/
2. winMW をインストールする
Cコンパイラをインストールしていない場合は winMW をインストールします。
http://iweb.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe
ダウンロードしたファイルを実行してインストールします。
64 bit OS の場合、Architectureは x86_64を選択します。
minGWのインストーラーはパスを通してくれないので、環境変数のPATHに追記します。
minGW-8.1.0の場合は「C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin」ですがバージョン上がるとpathが変わるようなのでエクスプローラで確認して追記します。
パスが通ったらコマンドプロンプトから確認しておきます。
無事通ったようです。
3. gitでcloneしてコンパイルする
xgboostのファイルを置くフォルダに移動したら、git cloneします。
git clone --recursive https://github.com/dmlc/xgboost
cloneしたxgboostフォルダに移動してコンパイルします。
cd xgboost
alias make='mingw32-make'
cd dmlc-core
make
cd ../rabit
make lib/librabit_empty.a
cd ..
cp make/mingw64.mk config.mk
make
cd python-package
python setup.py install
最後にpipでインストールするしたら完了です。
pip install xgboost