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

Algorithms
----------

7
Refer to `Features <./Features.rst>`__ for understanding of 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
--------------------------

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

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
+-------------------------+----------------------------------------------------------------------------------------+
| Class                   | Description                                                                            |
+=========================+========================================================================================+
| ``Application``         | The entrance of application, including training and prediction logic                   |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Bin``                 | Data structure used for storing feature discrete values (converted from float values)  |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Boosting``            | Boosting interface (GBDT, DART, GOSS, etc.)                                            |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Config``              | Stores parameters and configurations                                                   |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Dataset``             | Stores information of dataset                                                          |
+-------------------------+----------------------------------------------------------------------------------------+
| ``DatasetLoader``       | Used to construct dataset                                                              |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Feature``             | Stores one column feature                                                              |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Metric``              | Evaluation metrics                                                                     |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Network``             | Network interfaces and communication algorithms                                        |
+-------------------------+----------------------------------------------------------------------------------------+
| ``ObjectiveFunction``   | Objective functions used to train                                                      |
+-------------------------+----------------------------------------------------------------------------------------+
| ``Tree``                | Stores information of tree model                                                       |
+-------------------------+----------------------------------------------------------------------------------------+
| ``TreeLearner``         | Used to learn trees                                                                    |
+-------------------------+----------------------------------------------------------------------------------------+
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
42
43
44
45
46

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

+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
47
| Path                | Description                                                                                                                        |
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
48
+=====================+====================================================================================================================================+
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
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/application   | Implementations of training and prediction logic                                                                                   |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/boosting      | Implementations of Boosting                                                                                                        |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
57
| ./src/io            | Implementations of IO related classes, including ``Bin``, ``Config``, ``Dataset``, ``DatasetLoader``, ``Feature`` and ``Tree``     |
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
58
59
60
61
62
63
64
65
66
67
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/metric        | Implementations of metrics                                                                                                         |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/network       | Implementations of network functions                                                                                               |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/objective     | Implementations of objective functions                                                                                             |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+
| ./src/treelearner   | Implementations of tree learners                                                                                                   |
+---------------------+------------------------------------------------------------------------------------------------------------------------------------+

68
Documents API
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
69
70
~~~~~~~~~~~~~

71
Refer to `docs README <./README.rst>`__.
72

Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
73
74
75
C API
-----

76
Refer to `C API <./C-API.rst>`__ or the comments in `c\_api.h <https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/c_api.h>`__ file, from which the documentation is generated.
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
77

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>`__ and `R-package <https://github.com/microsoft/LightGBM/tree/master/R-package>`__.
82
83
84

Questions
---------
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
85

86
Refer to `FAQ <./FAQ.rst>`__.
Tsukasa OMOTO's avatar
Tsukasa OMOTO committed
87

88
Also feel free to open `issues <https://github.com/microsoft/LightGBM/issues>`__ if you met problems.