Skip to content

Commit

Permalink
[docs] document how to pass multi-value params from Python and R (fixes
Browse files Browse the repository at this point in the history
#4345) (#4346)

* [R-package] add docs and tests on monotone constraints (fixes #4345)

* remove tests

* move doc to top level

* slightly more specific

* Update docs/Parameters.rst

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
  • Loading branch information
jameslamb and StrikerRUS authored Jun 9, 2021
1 parent d677d6c commit 24ac920
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ By using config files, one line can only contain one parameter. You can use ``#`

If one parameter appears in both command line and config file, LightGBM will use the parameter from the command line.

For the Python and R packages, any parameters that accept a list of values (usually they have ``multi-xxx`` type, e.g. ``multi-int`` or ``multi-double``) can be specified in those languages' default array types.
For example, ``monotone_constraints`` can be specified as follows.

**Python**

.. code-block:: python
params = {
"monotone_constraints": [-1, 0, 1]
}
**R**

.. code-block:: r
params <- list(
monotone_constraints = c(-1, 0, 1)
)
.. start params list
Core Parameters
Expand Down

0 comments on commit 24ac920

Please sign in to comment.