2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Win10 に xgboostをインストールする

Last updated at Posted at 2019-04-09

xgboostをWin10にインストールする手順をメモしておきます。
Cコンパイラでmakeしないとインストールできないようで、Windows環境だとちょっと面倒です。

以下の手順そのままです
https://www.kaggle.com/questions-and-answers/31960

試行環境

Windows10
python 3.6

手順

  1. git をインストールする
  2. winMW をインストールする
  3. gitでcloneしてコンパイルする

1. git をインストールする

git bash がない場合は以下からダウンロードします
https://gitforwindows.org/

ダウンロードしたファイルを実行してインストールします。
image.png

2. winMW をインストールする

Cコンパイラをインストールしていない場合は winMW をインストールします。
http://iweb.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe

ダウンロードしたファイルを実行してインストールします。
image.png
64 bit OS の場合、Architectureは x86_64を選択します。
image.png

minGWのインストーラーはパスを通してくれないので、環境変数のPATHに追記します。
minGW-8.1.0の場合は「C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin」ですがバージョン上がるとpathが変わるようなのでエクスプローラで確認して追記します。

パスが通ったらコマンドプロンプトから確認しておきます。
image.png
無事通ったようです。

3. gitでcloneしてコンパイルする

git bashを起動します。
image.png

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でインストールするしたら完了です。

python
pip install xgboost
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?