__init__.py 1.39 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 pathlib import Path
8

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

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


27
_version_path = Path(__file__).absolute().parent / "VERSION.txt"
28
if _version_path.is_file():
29
    __version__ = _version_path.read_text(encoding="utf-8").strip()
wxchan's avatar
wxchan committed
30

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
__all__ = [
    "Dataset",
    "Booster",
    "CVBooster",
    "Sequence",
    "register_logger",
    "train",
    "cv",
    "LGBMModel",
    "LGBMRegressor",
    "LGBMClassifier",
    "LGBMRanker",
    "DaskLGBMRegressor",
    "DaskLGBMClassifier",
    "DaskLGBMRanker",
    "log_evaluation",
    "record_evaluation",
    "reset_parameter",
    "early_stopping",
    "EarlyStopException",
    "plot_importance",
    "plot_split_value_histogram",
    "plot_metric",
    "plot_tree",
    "create_tree_digraph",
]