"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "91f72e2a8c8b1e5433d30d3891923b3a067402a6"
__init__.py 1.9 KB
Newer Older
wxchan's avatar
wxchan committed
1
2
3
# coding: utf-8
"""LightGBM, Light Gradient Boosting Machine.

4
Contributors: https://github.com/Microsoft/LightGBM/graphs/contributors.
wxchan's avatar
wxchan committed
5
6
7
"""
from __future__ import absolute_import

8
from .basic import Booster, Dataset
9
10
11
from .callback import (early_stopping, print_evaluation, record_evaluation,
                       reset_parameter)
from .engine import cv, train
12

Guolin Ke's avatar
Guolin Ke committed
13
import os
14
15
import warnings
from platform import system
16

wxchan's avatar
wxchan committed
17
18
19
20
try:
    from .sklearn import LGBMModel, LGBMRegressor, LGBMClassifier, LGBMRanker
except ImportError:
    pass
21
try:
22
    from .plotting import plot_importance, plot_metric, plot_tree, create_tree_digraph
23
24
except ImportError:
    pass
wxchan's avatar
wxchan committed
25
26


27
28
29
dir_path = os.path.dirname(os.path.realpath(__file__))

if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')):
30
31
    with open(os.path.join(dir_path, 'VERSION.txt')) as version_file:
        __version__ = version_file.read().strip()
wxchan's avatar
wxchan committed
32

33
__all__ = ['Dataset', 'Booster',
wxchan's avatar
wxchan committed
34
           'train', 'cv',
35
           'LGBMModel', 'LGBMRegressor', 'LGBMClassifier', 'LGBMRanker',
36
           'print_evaluation', 'record_evaluation', 'reset_parameter', 'early_stopping',
37
           'plot_importance', 'plot_metric', 'plot_tree', 'create_tree_digraph']
38

39
# REMOVEME: remove warning after 2.3.0 version release
40
if system() == 'Darwin':
41
    warnings.warn("Starting from version 2.2.1, the library file in distribution wheels for macOS "
42
                  "is built by the Apple Clang (Xcode_8.3.3) compiler.\n"
43
                  "This means that in case of installing LightGBM from PyPI via the ``pip install lightgbm`` command, "
44
45
                  "you don't need to install the gcc compiler anymore.\n"
                  "Instead of that, you need to install the OpenMP library, "
46
                  "which is required for running LightGBM on the system with the Apple Clang compiler.\n"
47
                  "You can install the OpenMP library by the following command: ``brew install libomp``.", UserWarning)