PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/python-package/README.rst

https://gitlab.com/admin-github-cloud/xgboost
ReStructuredText | 67 lines | 55 code | 12 blank | 0 comment | 0 complexity | 90fb80afc7060fbbc51e765ca3fb3e0b MD5 | raw file
  1. XGBoost Python Package
  2. ======================
  3. |PyPI version|
  4. Installation
  5. ------------
  6. We are on `PyPI <https://pypi.python.org/pypi/xgboost>`__ now. For
  7. stable version, please install using pip:
  8. - ``pip install xgboost``
  9. - Since this package contains C++ source code, ``pip`` needs a C++ compiler from the system
  10. to compile the source code on-the-fly. Please follow the following instruction for each
  11. supported platform.
  12. - Note for Mac OS X users: please install ``gcc`` from ``brew`` by
  13. ``brew tap homebrew/versions; brew install gcc --without-multilib`` firstly.
  14. - Note for Linux users: please install ``gcc`` by ``sudo apt-get install build-essential`` firstly
  15. or using the corresponding package manager of the system.
  16. - Note for windows users: this pip installation may not work on some
  17. windows environment, and it may cause unexpected errors. pip
  18. installation on windows is currently disabled for further
  19. invesigation, please install from github.
  20. For up-to-date version, please install from github.
  21. - To make the python module, type ``./build.sh`` in the root directory
  22. of project
  23. - Make sure you have
  24. `setuptools <https://pypi.python.org/pypi/setuptools>`__
  25. - Install with ``cd python-package; python setup.py install`` from this directory.
  26. - For windows users, please use the Visual Studio project file under
  27. `windows folder <../windows/>`__. See also the `installation
  28. tutorial <https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13043/run-xgboost-from-windows-and-python>`__
  29. from Kaggle Otto Forum.
  30. - Add MinGW to the system PATH in Windows if you are using the latest version of xgboost which requires compilation:
  31. ```python
  32. import os
  33. os.environ['PATH'] = os.environ['PATH'] + ';C:\\Program Files\\mingw-w64\\x86_64-5.3.0-posix-seh-rt_v4-rev0\\mingw64\\bin'
  34. ```
  35. Examples
  36. --------
  37. - Refer also to the walk through example in `demo
  38. folder <https://github.com/dmlc/xgboost/tree/master/demo/guide-python>`__
  39. - See also the `example scripts <https://github.com/dmlc/xgboost/tree/master/demo/kaggle-higgs>`__ for Kaggle
  40. Higgs Challenge, including `speedtest
  41. script <https://github.com/dmlc/xgboost/tree/master/demo/kaggle-higgs/speedtest.py>`__ on this dataset.
  42. Note
  43. ----
  44. - If you want to build xgboost on Mac OS X with multiprocessing support
  45. where clang in XCode by default doesn't support, please install gcc
  46. 4.9 or higher using `homebrew <http://brew.sh/>`__
  47. ``brew tap homebrew/versions; brew install gcc --without-multilib``
  48. - If you want to run XGBoost process in parallel using the fork backend
  49. for joblib/multiprocessing, you must build XGBoost without support
  50. for OpenMP by ``make no_omp=1``. Otherwise, use the forkserver (in
  51. Python 3.4) or spawn backend. See the
  52. `sklearn\_parallel.py <../demo/guide-python/sklearn_parallel.py>`__
  53. demo.
  54. .. |PyPI version| image:: https://badge.fury.io/py/xgboost.svg
  55. :target: http://badge.fury.io/py/xgboost