"R-package/vscode:/vscode.git/clone" did not exist on "36732f23baa9e87617ea7700a9f59d7f53e313c6"
Commit 6d34fb86 authored by Nikita Titov's avatar Nikita Titov Committed by Guolin Ke
Browse files

[docs] move wiki to Read the Docs (#945)

* fixed Python-API references

* moved Features section to ReadTheDocs

* fixed index of ReadTheDocs

* moved Experiments section to ReadTheDocs

* fixed capital letter

* fixed citing

* moved Parallel Learning section to ReadTheDocs

* fixed markdown

* fixed Python-API

* fixed link to Quick-Start

* fixed gpu docker README

* moved Installation Guide from wiki to ReadTheDocs

* removed references to wiki

* fixed capital letters in headings

* hotfixes

* fixed non-Unicode symbols and reference to Python API

* fixed citing references

* fixed links in .md files

* fixed links in .rst files

* store images locally in the repo

* fixed missed word

* fixed indent in Experiments.rst

* fixed 'Duplicate implicit target name' message which is successfully
resolved by adding anchors

* less verbose

* prevented maito: ref creation

* fixed indents

* fixed 404

* fixed 403

* fixed 301

* fixed fake anchors

* fixed file extentions

* fixed Sphinx warnings

* added StrikerRUS profile link to FAQ

* added henry0312 profile link to FAQ
parent 4d15e4ff
PMML Generator PMML Generator
============== ==============
The script pmml.py can be used to translate the LightGBM models, found in LightGBM_model.txt, to predictive model markup language (PMML). These models can then be imported by other analytics applications. The models that the language can describe includes decision trees. The specification of PMML can be found here at the Data Mining Group's [website](http://dmg.org/pmml/v4-3/GeneralStructure.html). The script pmml.py can be used to translate the LightGBM models, found in LightGBM_model.txt, to predictive model markup language (PMML). These models can then be imported by other analytics applications. The models that the language can describe includes decision trees. The specification of PMML can be found here at the Data Mining Group's [website](http://dmg.org/pmml/v4-3/GeneralStructure.html).
In order to generate pmml files do the following steps. In order to generate pmml files do the following steps.
...@@ -7,19 +8,27 @@ In order to generate pmml files do the following steps. ...@@ -7,19 +8,27 @@ In order to generate pmml files do the following steps.
lightgbm config=train.conf lightgbm config=train.conf
python pmml.py LightGBM_model.txt python pmml.py LightGBM_model.txt
``` ```
The python script will create a file called **LightGBM_pmml.xml**. Inside the file you will find a `MiningModel` tag. In there you will find `TreeModel` tags. Each `TreeModel` tag contains the pmml translation of a decision tree inside the LightGBM_model.txt file. The model described by the **LightGBM_pmml.xml** file can be transferred to other analytics applications. For instance you can use the pmml file as an input to the jpmml-evaluator API. Follow the steps below to run a model described by **LightGBM_pmml.xml**. The python script will create a file called **LightGBM_pmml.xml**. Inside the file you will find a `MiningModel` tag. In there you will find `TreeModel` tags. Each `TreeModel` tag contains the pmml translation of a decision tree inside the LightGBM_model.txt file. The model described by the **LightGBM_pmml.xml** file can be transferred to other analytics applications. For instance you can use the pmml file as an input to the jpmml-evaluator API. Follow the steps below to run a model described by **LightGBM_pmml.xml**.
##### Steps to run jpmml-evaluator ##### Steps to Run jpmml-evaluator
1, First clone the repository
1. Clone the repository
``` ```
git clone https://github.com/jpmml/jpmml-evaluator.git git clone https://github.com/jpmml/jpmml-evaluator.git
``` ```
2, Build using maven
2. Build using maven
``` ```
mvn clean install mvn clean install
``` ```
3, Run the EvaluationExample class on the model file using the following command
3. Run the EvaluationExample class on the model file using the following command
``` ```
java -cp example-1.3-SNAPSHOT.jar org.jpmml.evaluator.EvaluationExample --model LightGBM_pmml.xml --input input.csv --output output.csv java -cp example-1.3-SNAPSHOT.jar org.jpmml.evaluator.EvaluationExample --model LightGBM_pmml.xml --input input.csv --output output.csv
``` ```
Note, in order to run the model on the input.csv file, the input.csv file must have the same number of columns as specified by the `DataDictionary` field in the pmml file. Also, the column headers inside the input.csv file must be the same as the column names specified by the `MiningSchema` field. Inside output.csv you will find all the columns inside the input.csv file plus a new column. In the new column you will find the scores calculated by processing each rows data on the model. More information about jpmml-evaluator can be found at its [github repository](https://github.com/jpmml/jpmml-evaluator). Note, in order to run the model on the input.csv file, the input.csv file must have the same number of columns as specified by the `DataDictionary` field in the pmml file. Also, the column headers inside the input.csv file must be the same as the column names specified by the `MiningSchema` field. Inside output.csv you will find all the columns inside the input.csv file plus a new column. In the new column you will find the scores calculated by processing each rows data on the model. More information about jpmml-evaluator can be found at its [github repository](https://github.com/jpmml/jpmml-evaluator).
\ No newline at end of file
...@@ -11,11 +11,11 @@ Preparation ...@@ -11,11 +11,11 @@ Preparation
`setuptools <https://pypi.python.org/pypi/setuptools>`_ is needed. `setuptools <https://pypi.python.org/pypi/setuptools>`_ is needed.
For Mac OS X users, gcc with OpenMP support must be installed first. Refer to `wiki <https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#osx>`_ for installing gcc with OpenMP support. For Mac OS X users, gcc with OpenMP support must be installed first. Refer to `Installation Guide <https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#osx>`_ for installing gcc with OpenMP support.
Note: 32-bit python is not supported. Please install 64-bit version. Note: 32-bit Python is not supported. Please install 64-bit version.
Install from `PyPI <https://pypi.python.org/pypi/lightgbm>`_ using ``pip`` Install from `PyPI <https://pypi.python.org/pypi/lightgbm>`_ Using ``pip``
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
For Windows users, `VC runtime <https://go.microsoft.com/fwlink/?LinkId=746572>`_ is needed if Visual Studio (2013, 2015 or 2017) is not installed. For Windows users, `VC runtime <https://go.microsoft.com/fwlink/?LinkId=746572>`_ is needed if Visual Studio (2013, 2015 or 2017) is not installed.
...@@ -25,7 +25,7 @@ Install `wheel <http://pythonwheels.com>`_ via ``pip install wheel`` first. Afte ...@@ -25,7 +25,7 @@ Install `wheel <http://pythonwheels.com>`_ via ``pip install wheel`` first. Afte
pip install lightgbm pip install lightgbm
Build from sources Build from Sources
****************** ******************
.. code:: sh .. code:: sh
...@@ -38,7 +38,7 @@ For Mac OS X users, you need to specify compilers by runnig ``export CXX=g++-7 C ...@@ -38,7 +38,7 @@ For Mac OS X users, you need to specify compilers by runnig ``export CXX=g++-7 C
For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017>`_) is needed. If you get any errors during installation, you may need to install `CMake <https://cmake.org/>`_ (version 3.8 or higher). For Windows users, Visual Studio (or `MS Build <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017>`_) is needed. If you get any errors during installation, you may need to install `CMake <https://cmake.org/>`_ (version 3.8 or higher).
Build GPU version Build GPU Version
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
.. code:: sh .. code:: sh
...@@ -47,7 +47,7 @@ Build GPU version ...@@ -47,7 +47,7 @@ Build GPU version
For Windows users, `CMake <https://cmake.org/>`_ (version 3.8 or higher) is strongly required in this case. For Windows users, `CMake <https://cmake.org/>`_ (version 3.8 or higher) is strongly required in this case.
Note: Boost and OpenCL are needed: details for installation can be found in `gpu-support <https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#with-gpu-support>`_. You need to add ``OpenCL_INCLUDE_DIR`` to the environmental variable **'PATH'** and export ``BOOST_ROOT`` before installation. Note: Boost and OpenCL are needed: details for installation can be found in `Installation Guide <https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#build-gpu-version>`_. You need to add ``OpenCL_INCLUDE_DIR`` to the environmental variable **'PATH'** and export ``BOOST_ROOT`` before installation.
Build with MinGW-w64 on Windows Build with MinGW-w64 on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -76,14 +76,14 @@ Note: ``sudo`` (or administrator rights in Windows) may be needed to perform the ...@@ -76,14 +76,14 @@ Note: ``sudo`` (or administrator rights in Windows) may be needed to perform the
Run ``python setup.py install --mingw`` if you want to use MinGW-w64 on Windows instead of Visual Studio. `CMake <https://cmake.org/>`_ and `MinGW-w64 <https://mingw-w64.org/>`_ should be installed first. Run ``python setup.py install --mingw`` if you want to use MinGW-w64 on Windows instead of Visual Studio. `CMake <https://cmake.org/>`_ and `MinGW-w64 <https://mingw-w64.org/>`_ should be installed first.
Run ``python setup.py install --gpu`` to enable GPU support. For Windows users, `CMake <https://cmake.org/>`_ (version 3.8 or higher) is strongly required in this case. Boost and OpenCL are needed: details for installation can be found in `gpu-support <https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#with-gpu-support>`_. Run ``python setup.py install --gpu`` to enable GPU support. For Windows users, `CMake <https://cmake.org/>`_ (version 3.8 or higher) is strongly required in this case. Boost and OpenCL are needed: details for installation can be found in `Installation Guide <https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#build-gpu-version>`_.
If you get any errors during installation or due to any other reason, you may want to build dynamic library from sources by any method you prefer (see `Installation-Guide <https://github.com/Microsoft/LightGBM/wiki/Installation-Guide>`_) and then run ``python setup.py install --precompile``. If you get any errors during installation or due to any other reason, you may want to build dynamic library from sources by any method you prefer (see `Installation Guide <https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst>`_) and then run ``python setup.py install --precompile``.
Examples Examples
-------- --------
Refer to the walk through examples in `python-guide folder <https://github.com/Microsoft/LightGBM/tree/master/examples/python-guide>`_. Refer to the walk through examples in `Python guide folder <https://github.com/Microsoft/LightGBM/tree/master/examples/python-guide>`_.
Troubleshooting Troubleshooting
--------------- ---------------
...@@ -93,7 +93,7 @@ Refer to `FAQ <https://github.com/Microsoft/LightGBM/tree/master/docs/FAQ.md>`_. ...@@ -93,7 +93,7 @@ Refer to `FAQ <https://github.com/Microsoft/LightGBM/tree/master/docs/FAQ.md>`_.
Developments Developments
------------ ------------
The code style of python package follows `pep8 <https://www.python.org/dev/peps/pep-0008/>`_. If you would like to make a contribution and not familiar with pep-8, please check the pep8 style guide first. Otherwise, the check won't pass. You should be careful about: The code style of Python-package follows `pep8 <https://www.python.org/dev/peps/pep-0008/>`_. If you would like to make a contribution and not familiar with pep-8, please check the pep8 style guide first. Otherwise, the check won't pass. You should be careful about:
- E1 Indentation (check pep8 link above) - E1 Indentation (check pep8 link above)
- E202 whitespace before and after brackets - E202 whitespace before and after brackets
......
...@@ -85,7 +85,7 @@ def train(params, train_set, num_boost_round=100, ...@@ -85,7 +85,7 @@ def train(params, train_set, num_boost_round=100,
You can still use _InnerPredictor as ``init_model`` for future continue training. You can still use _InnerPredictor as ``init_model`` for future continue training.
callbacks : list of callables or None, optional (default=None) callbacks : list of callables or None, optional (default=None)
List of callback functions that are applied at each iteration. List of callback functions that are applied at each iteration.
See Callbacks in Python-API.md for more information. See Callbacks in Python API for more information.
Returns Returns
------- -------
...@@ -369,7 +369,7 @@ def cv(params, train_set, num_boost_round=10, ...@@ -369,7 +369,7 @@ def cv(params, train_set, num_boost_round=10,
Seed used to generate the folds (passed to numpy.random.seed). Seed used to generate the folds (passed to numpy.random.seed).
callbacks : list of callables or None, optional (default=None) callbacks : list of callables or None, optional (default=None)
List of callback functions that are applied at each iteration. List of callback functions that are applied at each iteration.
See Callbacks in Python-API.md for more information. See Callbacks in Python API for more information.
Returns Returns
------- -------
......
...@@ -196,7 +196,7 @@ class LGBMModel(_LGBMModelBase): ...@@ -196,7 +196,7 @@ class LGBMModel(_LGBMModelBase):
Note Note
---- ----
**kwargs is not supported in sklearn, it may cause unexpected issues. \*\*kwargs is not supported in sklearn, it may cause unexpected issues.
Attributes Attributes
---------- ----------
...@@ -341,7 +341,7 @@ class LGBMModel(_LGBMModelBase): ...@@ -341,7 +341,7 @@ class LGBMModel(_LGBMModelBase):
If 'auto' and data is pandas DataFrame, pandas categorical columns are used. If 'auto' and data is pandas DataFrame, pandas categorical columns are used.
callbacks : list of callback functions or None, optional (default=None) callbacks : list of callback functions or None, optional (default=None)
List of callback functions that are applied at each iteration. List of callback functions that are applied at each iteration.
See Callbacks in Python-API.md for more information. See Callbacks in Python API for more information.
Returns Returns
------- -------
...@@ -370,6 +370,7 @@ class LGBMModel(_LGBMModelBase): ...@@ -370,6 +370,7 @@ class LGBMModel(_LGBMModelBase):
The eval result. The eval result.
is_bigger_better: bool is_bigger_better: bool
Is eval result bigger better, e.g. AUC is bigger_better. Is eval result bigger better, e.g. AUC is bigger_better.
For multi-class task, the y_pred is group by class_id first, then group by row_id. For multi-class task, the y_pred is group by class_id first, then group by row_id.
If you want to get i-th row y_pred in j-th class, the access way is y_pred[j * num_data + i]. If you want to get i-th row y_pred in j-th class, the access way is y_pred[j * num_data + i].
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment