Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC improve the warm_start glossary entry #25523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1666,10 +1666,24 @@ functions or non-estimator constructors.
in a subsequent call to :term:`fit`.

Note that this is only applicable for some models and some
parameters, and even some orders of parameter values. For example,
``warm_start`` may be used when building random forests to add more
trees to the forest (increasing ``n_estimators``) but not to reduce
their number.
parameters, and even some orders of parameter values. In general, there
is an interaction between ``warm_start`` and the parameter controlling
the number of iterations of the estimator.

For estimators imported from :mod:`ensemble`,
``warm_start`` will interact with ``n_estimators`` or ``max_iter``.
For these models, the number of iterations, reported via
``len(estimators_)`` or ``n_iter_``, corresponds the total number of
estimators/iterations learnt since the initialization of the model.
Thus, if a model was already initialized with `N`` estimators, and `fit`
is called with ``n_estimators`` or ``max_iter`` set to `M`, the model
will train `M - N` new estimators.

Other models, usually using gradient-based solvers, have a different
behavior. They all expose a ``max_iter`` parameter. The reported
``n_iter_`` corresponds to the number of iteration done during the last
call to ``fit`` and will be at most ``max_iter``. Thus, we do not
consider the state of the estimator since the initialization.

:term:`partial_fit` also retains the model between calls, but differs:
with ``warm_start`` the parameters change and the data is
Expand Down