__init__.py 1.36 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
from pathlib import Path
7

8
from .basic import Booster, Dataset, Sequence, register_logger
9
from .callback import early_stopping, log_evaluation, 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
_version_path = Path(__file__).absolute().parent / 'VERSION.txt'
27
28
if _version_path.is_file():
    __version__ = _version_path.read_text(encoding='utf-8').strip()
wxchan's avatar
wxchan committed
29

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