需要使用Python跑一些模型
直接使用 pip install xgboost安裝,會(huì)報(bào)如下錯(cuò)誤:
Command "python setup.py egg_info" failed with error code 1
于是查找相應(yīng)資料,使用Git成功安裝。步驟如下:
cd ~
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost ; bash build.sh
cd python-package; sudo python setup.py install
rm -rf xgboost
顯示Finished processing dependencies for xgboost==0.6即安裝成功。我的Python版本是2.7。
如果沒有安裝gcc,還需要先安裝gcc。
brew install gcc
順便也介紹 Anaconda 安裝 xgboost 的命令
conda install py-xgboost
參考資料:
http://blog.csdn.net/u014365862/article/details/73739857
http://blog.csdn.net/honorin/article/details/70162962