__init__.py 1.53 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
10
# .basic is intentionally loaded as early as possible, to dlopen() lib_lightgbm.{dll,dylib,so}
# and its dependencies as early as possible
11
from .basic import Booster, Dataset, Sequence, register_logger
12
from .callback import EarlyStopException, early_stopping, log_evaluation, record_evaluation, reset_parameter
13
from .engine import CVBooster, cv, train
14

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


29
_version_path = Path(__file__).absolute().parent / "VERSION.txt"
30
if _version_path.is_file():
31
    __version__ = _version_path.read_text(encoding="utf-8").strip()
wxchan's avatar
wxchan committed
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
57
58
__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",
]