development.rst 7.21 KB
Newer Older
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
1
2
3
4
5
6
Development Guide
=================

Algorithms
----------

7
Refer to `Features <https://github.com/Microsoft/LightGBM/wiki/Features>`__ to understand important algorithms used in LightGBM.
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
8

9
Classes and Code Structure
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--------------------------

Important Classes
~~~~~~~~~~~~~~~~~

+-------------------------+--------------------------------------------------------------------------------------+
| Class                   | description                                                                          |
+=========================+======================================================================================+
| ``Application``         | The entrance of application, including training and prediction logic                 |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Bin``                 | Data structure used for store feature discrete values(converted from float values)   |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Boosting``            | Boosting interface, current implementation is GBDT and DART                          |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Config``              | Store parameters and configurations                                                  |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Dataset``             | Store information of dataset                                                         |
+-------------------------+--------------------------------------------------------------------------------------+
| ``DatasetLoader``       | Used to construct dataset                                                            |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Feature``             | Store One column feature                                                             |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Metric``              | Evaluation metrics                                                                   |
+-------------------------+--------------------------------------------------------------------------------------+
34
| ``Network``             | Network interfaces and communication algorithms                                      |
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
+-------------------------+--------------------------------------------------------------------------------------+
| ``ObjectiveFunction``   | Objective function used to train                                                     |
+-------------------------+--------------------------------------------------------------------------------------+
| ``Tree``                | Store information of tree model                                                      |
+-------------------------+--------------------------------------------------------------------------------------+
| ``TreeLearner``         | Used to learn trees                                                                  |
+-------------------------+--------------------------------------------------------------------------------------+

Code Structure
~~~~~~~~~~~~~~

+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| Path                | description                                                                                                                        |
+=====================+====================================================================================================================================+
49
| ./include           | Header files                                                                                                                       |
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
50
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
51
| ./include/utils     | Some common functions                                                                                                              |
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/application   | Implementations of training and prediction logic                                                                                   |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/boosting      | Implementations of Boosting                                                                                                        |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/io            | Implementations of IO relatived classes, including ``Bin``, ``Config``, ``Dataset``, ``DatasetLoader``, ``Feature`` and ``Tree``   |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/metric        | Implementations of metrics                                                                                                         |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/network       | Implementations of network functions                                                                                               |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/objective     | Implementations of objective functions                                                                                             |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/treelearner   | Implementations of tree learners                                                                                                   |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+

API Documents
~~~~~~~~~~~~~

LightGBM support use `doxygen <http://www.stack.nl/~dimitri/doxygen/>`__ to generate documents for classes and functions.

C API
-----

Refere to the comments in `c\_api.h <https://github.com/Microsoft/LightGBM/blob/master/include/LightGBM/c_api.h>`__.

78
High Level Language Package
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
79
80
---------------------------

81
See the implementations at `python-package <https://github.com/Microsoft/LightGBM/tree/master/python-package/lightgbm>`__ and `R-package <https://github.com/Microsoft/LightGBM/tree/master/R-package>`__.
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
82
83
84
85
86

Ask Questions
-------------

Feel free to open `issues <https://github.com/Microsoft/LightGBM/issues>`__ if you met problems.