__init__.py 1.41 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 .basic import Booster, Dataset, register_logger
7
8
from .callback import (early_stopping, print_evaluation, record_evaluation,
                       reset_parameter)
9
from .engine import cv, train, CVBooster
10

Guolin Ke's avatar
Guolin Ke committed
11
import os
12

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


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

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

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