Behaviour of warm_start=True
and max_iter
(and n_estimators
)
#25522
Labels
warm_start=True
and max_iter
(and n_estimators
)
#25522
This issue is an RFC to clarify the expected behavior
max_iter
andn_iter_
(orestimators
andlen(estimators_)
equivalently) when used withwarm_start=True
.Estimators to be considered
The estimators to be considered can be found in the following manner:
which give
Review the different behaviors
We will evaluate the behaviour by doing the following experiment:
max_iter=2
(orn_estimators=2
) andwarm_start=True
fit
the estimator and checkn_iter_
(orlen(estimators_)
)max_iter=3
(orn_estimators=3
)fit
the estimator and checkn_iter_
(orlen(estimators_)
)The idea is to check if we report the total number of iterations or just the number of iterations of the latest
fit
call.GLM estimators
In this case,
n_iter_
is reported to be2
and then3
. Using theverbose
option, the model did effectively5
iterations.Ensemble estimators
In this case,
len(estimators_)
is2
and3
. It differs from the previous GLM because we have in total only3
estimators.Similar behaviour for
HistGradientBoosting
:Estimators using coordinate descent
It will be similar for
MultiTaskElasticNet
andMultiTaskLasso
.This is equivalent to GLM. The
_path
is called usingself.max_iter
without taking into accountn_iter_
. So the total number of iterations will be5
.MLP estimators:
n_iter_
is reported to be2
and5
. So thefit
behavior is consistent with other linear model but the reportedn_iter_
report the global number of iterations.SGD estimators
n_iter_
is reported to be2
and3
and make5
iterations in total. In line with GLMs.Perceptron
will expose the same behaviour.Other estimators
HuberRegressor
is behaving the same as GLMsThe text was updated successfully, but these errors were encountered: