From 7bb722f5fa0af032e2bbf08ebac3eca9840135f7 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 5 Oct 2018 11:46:05 -0400 Subject: [PATCH 1/3] Updated contributin.rst --- doc/developers/contributing.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index 8360b2f3bb331..97a4b93e2a981 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -1152,8 +1152,9 @@ some regression estimator would be stored in a ``coef_`` attribute after ``fit`` has been called. The last-mentioned attributes are expected to be overridden when -you call ``fit`` a second time without taking any previous value into -account: **fit should be idempotent**. +you call ``fit`` a second time, without taking any previous value into +account. Also, **fit should be idempotent**: ``clf.fit(X).fit(X)`` should be +equivalent to ``clf.fit(X)``. Optional Arguments ^^^^^^^^^^^^^^^^^^ From 3209692eabb576ed9fa8f266c90376ffdedcc5b8 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 5 Oct 2018 14:19:04 -0400 Subject: [PATCH 2/3] Moved to Fitting part and added reference to random_state --- doc/developers/contributing.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index 97a4b93e2a981..52bba09c9363a 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -1143,6 +1143,12 @@ data dependent. A tolerance stopping criterion ``tol`` is not directly data dependent (although the optimal value according to some scoring function probably is). +When ``fit`` is called, any previous call to ``fit`` should be ignored. In +general, calling ``estimator.fit(X1)`` and then ``estimator.fit(X2)`` should +be the same as only calling ``estimator.fit(X2)``. However, this may not be +true in practice when ``fit`` depends on some random process, see +:term:`random_state`. + Estimated Attributes ^^^^^^^^^^^^^^^^^^^^ @@ -1151,10 +1157,8 @@ ending with trailing underscore, for example the coefficients of some regression estimator would be stored in a ``coef_`` attribute after ``fit`` has been called. -The last-mentioned attributes are expected to be overridden when -you call ``fit`` a second time, without taking any previous value into -account. Also, **fit should be idempotent**: ``clf.fit(X).fit(X)`` should be -equivalent to ``clf.fit(X)``. +The estimated attributes are expected to be overridden when you call ``fit`` +a second time, without taking any previous value into account. Optional Arguments ^^^^^^^^^^^^^^^^^^ From 9159f5cb318180c7f32e2fc05e858e9628c1b707 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 8 Oct 2018 10:48:07 -0400 Subject: [PATCH 3/3] Added mention of warm starting --- doc/developers/contributing.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index 52bba09c9363a..ed2daa4d88d77 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -1147,7 +1147,11 @@ When ``fit`` is called, any previous call to ``fit`` should be ignored. In general, calling ``estimator.fit(X1)`` and then ``estimator.fit(X2)`` should be the same as only calling ``estimator.fit(X2)``. However, this may not be true in practice when ``fit`` depends on some random process, see -:term:`random_state`. +:term:`random_state`. Another exception to this rule is when the +hyper-parameter ``warm_start`` is set to ``True`` for estimators that +support it. ``warm_start=True`` means that the previous state of the +trainable parameters of the estimator are reused instead of using the +default initialization strategy. Estimated Attributes ^^^^^^^^^^^^^^^^^^^^ @@ -1158,7 +1162,7 @@ some regression estimator would be stored in a ``coef_`` attribute after ``fit`` has been called. The estimated attributes are expected to be overridden when you call ``fit`` -a second time, without taking any previous value into account. +a second time. Optional Arguments ^^^^^^^^^^^^^^^^^^