__init__.py 1.2 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 __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
12

Guolin Ke's avatar
Guolin Ke committed
13
import os
14

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


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

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

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