__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
from pathlib import Path
7

8
from .basic import Booster, Dataset, Sequence, register_logger
9
from .callback import EarlyStopException, early_stopping, log_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
if _version_path.is_file():
28
    __version__ = _version_path.read_text(encoding="utf-8").strip()
wxchan's avatar
wxchan committed
29

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
__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",
]