8000 Merge pull request #4392 from sinhrks/setparams · raghavrv/scikit-learn@48117d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48117d5

Browse files
committed
Merge pull request scikit-learn#4392 from sinhrks/setparams
DOC: Updated set_params doc
2 parents 6303af4 + f0d86e8 commit 48117d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/developers/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ The default value for ``deep`` should be true.
818818

819819
The ``set_params`` on the other hand takes as input a dict of the form
820820
``'parameter': value`` and sets the parameter of the estimator using this dict.
821+
Return value must be estimator itself.
821822

822823
While the ``get_params`` mechanism is not essential (see :ref:`cloning` below),
823824
the ``set_params`` function is necessary as it is used to set parameters during
@@ -835,6 +836,7 @@ implement the interface is::
835836
def set_params(self, **parameters):
836837
for parameter, value in parameters.items():
837838
self.setattr(parameter, value)
839+
return self
838840

839841

840842
Parameters and init

0 commit comments

Comments
 (0)
0