Unverified Commit dac0dffe authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[docs] improve docs about `nthreads` parameter (#4756)

* in predict(), respect params set via `set_params()` after fit()

* extract docs changes
parent d574fcbd
...@@ -183,6 +183,8 @@ Core Parameters ...@@ -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`` - ``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 - number of threads for LightGBM
- ``0`` means default number of threads in OpenMP - ``0`` means default number of threads in OpenMP
......
...@@ -192,6 +192,7 @@ struct Config { ...@@ -192,6 +192,7 @@ struct Config {
std::string tree_learner = "serial"; std::string tree_learner = "serial";
// alias = num_thread, nthread, nthreads, n_jobs // 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 = number of threads for LightGBM
// desc = ``0`` means default number of threads in OpenMP // 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) // 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)
......
...@@ -434,7 +434,7 @@ class LGBMModel(_LGBMModelBase): ...@@ -434,7 +434,7 @@ class LGBMModel(_LGBMModelBase):
If RandomState object (numpy), a random integer is picked based on its state to seed the C++ code. 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. If None, default seeds in C++ code are used.
n_jobs : int, optional (default=-1) 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) silent : bool, optional (default=True)
Whether to print messages while running boosting. Whether to print messages while running boosting.
importance_type : str, optional (default='split') importance_type : str, optional (default='split')
......
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