__init__.py 1.38 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
import os

8
from .basic import Booster, Dataset, Sequence, register_logger
9
from .callback import early_stopping, print_evaluation, record_evaluation, reset_parameter
10
from .engine import CVBooster, cv, train
11

wxchan's avatar
wxchan committed
12
try:
13
    from .sklearn import LGBMClassifier, LGBMModel, LGBMRanker, LGBMRegressor
wxchan's avatar
wxchan committed
14
15
except ImportError:
    pass
16
try:
17
    from .plotting import create_tree_digraph, plot_importance, plot_metric, plot_split_value_histogram, plot_tree
18
19
except ImportError:
    pass
20
try:
21
    from .dask import DaskLGBMClassifier, DaskLGBMRanker, DaskLGBMRegressor
22
23
except ImportError:
    pass
wxchan's avatar
wxchan committed
24
25


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

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

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