Skip to main content

LightGBM Python Package

Project description

PyPI version

Installation

Preparation

You need to install cmake and setuptools first.

For Windows users, Visual Studio (or MS Build) is needed. You also can use MinGW instead if installing from GitHub.

For Mac OS X users, gcc with OpenMP support must be installed first. Refer to wiki for installing gcc with OpenMP support.

Note: 32-bit python is not supported. Please install 64-bit version.

Install from pip

pip install lightgbm

For the MinGW build in Windows and GPU support, please install the latest version from GitHub.

Install from GitHub

git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM/python-package
python setup.py install

You may need to use sudo (or administrator rights in Windows) to perform python setup.py install.

Use python setup.py install --mingw to use MinGW in Windows.

Use python setup.py install --gpu to enable GPU support. You will need to install Boost and OpenCL first: details for installation can be found in gpu-support.

Examples

Refer to the walk through examples in python-guide folder

Troubleshooting

Refer to FAQ

Developments

The code style of python package follows pep8. If you would like to make a contribution and not familiar with pep-8, please check the pep8 style guide first. Otherwise, you won’t pass the check. You should be careful about:

  • E1 Indentation (check pep8 link above)

  • E202 whitespace before and after brackets

  • E225 missing whitespace around operator

  • E226 missing whitespace around arithmetic operator

  • E261 at least two spaces before inline comment

  • E301 expected 1 blank line in front of and at the end of a method

  • E302 expected 2 blank lines in front of and at the end of a function or a class

You can ignore E501 (line too long).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightgbm-2.0.2.tar.gz (204.6 kB view hashes)

Uploaded Source

Built Distributions

lightgbm-2.0.2-py2.py3-none-win_amd64.whl (897.0 kB view hashes)

Uploaded Python 2 Python 3 Windows x86-64

lightgbm-2.0.2-py2.py3-none-manylinux1_x86_64.whl (1.3 MB view hashes)

Uploaded Python 2 Python 3

lightgbm-2.0.2-py2.py3-none-macosx_10_9_x86_64.macosx_10_10_x86_64.macosx_10_11_x86_64.macosx_10_12_x86_64.whl (1.2 MB view hashes)

Uploaded Python 2 Python 3 macOS 10.10+ x86-64 macOS 10.11+ x86-64 macOS 10.12+ x86-64 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page