Skip to content

FIX MultiOutputRegressor.partial_fit and BernoulliRBM.partial_fit return self - #35349

Closed
lapsecoder wants to merge 1 commit into
scikit-learn:mainfrom
lapsecoder:fix/partial-fit-return-self
Closed

lapsecoder wants to merge 1 commit into
scikit-learn:mainfrom
lapsecoder:fix/partial-fit-return-self

Conversation

@lapsecoder

Copy link
Copy Markdown

Fixes #35347. partial_fit is documented to return self; these two implementations returned None.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Thank you for your interest in contributing to scikit-learn.

The linked issue is still under discussion, and the maintainers have not yet reached consensus on how it should be resolved. Before opening a pull request, please review the "Issues tagged 'Needs Triage'" section of the Contributing Guide:
https://scikit-learn.org/stable/developers/contributing.html#issues-tagged-needs-triage

For now, we are closing this pull request.

  • If you believe your proposed change addresses the linked issue, please explain your proposal in that issue, and allow time for discussion with the maintainers so that consensus can be reached before implementation begins.

  • If you believe this is a mistake, please leave a comment on the linked issue as well.

@github-actions github-actions Bot closed this Nov 8, 2026
@github-actions github-actions Bot added linked issue not ready PR opened before its linked issue reached consensus CI:Linter failure The linter CI is failing on this PR labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

❌ Linting issues

This PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling pre-commit hooks. Instructions to enable them can be found here.

You can see the details of the linting issues under the lint job here


ruff check

ruff detected issues. Please run ruff check --fix --output-format=full locally, fix the remaining issues, and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.12.2.

Details

sklearn/multioutput.py:430:89: E501 Line too long (91 > 88)
    |
428 |             Returns a fitted instance.
429 |         """
430 |         return super().partial_fit(X, y, sample_weight=sample_weight, **partial_fit_params)
    |                                                                                         ^^^ E501
    |

Found 1 error.

ruff format

ruff detected issues. Please run ruff format locally and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.12.2.

Details

--- sklearn/multioutput.py
+++ sklearn/multioutput.py
@@ -427,7 +427,9 @@
         self : object
             Returns a fitted instance.
         """
-        return super().partial_fit(X, y, sample_weight=sample_weight, **partial_fit_params)
+        return super().partial_fit(
+            X, y, sample_weight=sample_weight, **partial_fit_params
+        )
 
 
 class MultiOutputClassifier(ClassifierMixin, _MultiOutputEstimator):

1 file would be reformatted, 961 files already formatted

Generated for commit: 6206f92. Link to the linter CI: here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Linter failure The linter CI is failing on this PR linked issue not ready PR opened before its linked issue reached consensus module:neural_network size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: partial_fit returns None in MultiOutputRegressor and BernoulliRBM, contradicting its documented Returns self

1 participant