__init__.py 1.08 KB
Newer Older
wxchan's avatar
wxchan committed
1
2
3
4
5
6
7
# coding: utf-8
"""LightGBM, Light Gradient Boosting Machine.

Contributors: https://github.com/Microsoft/LightGBM/graphs/contributors
"""
from __future__ import absolute_import

8
from .basic import Booster, Dataset
9
10
11
from .callback import (early_stopping, print_evaluation, record_evaluation,
                       reset_parameter)
from .engine import cv, train
Guolin Ke's avatar
Guolin Ke committed
12
import os
13

wxchan's avatar
wxchan committed
14
15
16
17
try:
    from .sklearn import LGBMModel, LGBMRegressor, LGBMClassifier, LGBMRanker
except ImportError:
    pass
18
try:
19
    from .plotting import plot_importance, plot_metric, plot_tree, create_tree_digraph
20
21
except ImportError:
    pass
wxchan's avatar
wxchan committed
22
23


24
25
26
27
dir_path = os.path.dirname(os.path.realpath(__file__))

if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')):
    __version__ = open(os.path.join(dir_path, 'VERSION.txt')).read().strip()
wxchan's avatar
wxchan committed
28

29
__all__ = ['Dataset', 'Booster',
wxchan's avatar
wxchan committed
30
           'train', 'cv',
31
           'LGBMModel', 'LGBMRegressor', 'LGBMClassifier', 'LGBMRanker',
32
           'print_evaluation', 'record_evaluation', 'reset_parameter', 'early_stopping',
33
           'plot_importance', 'plot_metric', 'plot_tree', 'create_tree_digraph']