Skip to content

Commit

Permalink
[docs] improve docs about nthreads parameter (#4756)
Browse files Browse the repository at this point in the history
* in predict(), respect params set via `set_params()` after fit()

* extract docs changes
  • Loading branch information
StrikerRUS committed Oct 30, 2021
1 parent d574fcb commit dac0dff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/Parameters.rst
Expand Up @@ -183,6 +183,8 @@ Core Parameters

- ``num_threads`` :raw-html:`<a id="num_threads" title="Permalink to this parameter" href="#num_threads">&#x1F517;&#xFE0E;</a>`, default = ``0``, type = int, aliases: ``num_thread``, ``nthread``, ``nthreads``, ``n_jobs``

- used only in ``train``, ``prediction`` and ``refit`` tasks or in correspondent functions of language-specific packages

- number of threads for LightGBM

- ``0`` means default number of threads in OpenMP
Expand Down
1 change: 1 addition & 0 deletions include/LightGBM/config.h
Expand Up @@ -192,6 +192,7 @@ struct Config {
std::string tree_learner = "serial";

// alias = num_thread, nthread, nthreads, n_jobs
// desc = used only in ``train``, ``prediction`` and ``refit`` tasks or in correspondent functions of language-specific packages
// desc = number of threads for LightGBM
// desc = ``0`` means default number of threads in OpenMP
// desc = for the best speed, set this to the number of **real CPU cores**, not the number of threads (most CPUs use `hyper-threading <https://en.wikipedia.org/wiki/Hyper-threading>`__ to generate 2 threads per CPU core)
Expand Down
2 changes: 1 addition & 1 deletion python-package/lightgbm/sklearn.py
Expand Up @@ -434,7 +434,7 @@ def __init__(
If RandomState object (numpy), a random integer is picked based on its state to seed the C++ code.
If None, default seeds in C++ code are used.
n_jobs : int, optional (default=-1)
Number of parallel threads.
Number of parallel threads to use for training (can be changed at prediction time).
silent : bool, optional (default=True)
Whether to print messages while running boosting.
importance_type : str, optional (default='split')
Expand Down

0 comments on commit dac0dff

Please sign in to comment.