Skip to content

MNT carry out 1.10 deprecation of PassiveAggressive* estimators - #35134

Merged
lesteve merged 8 commits into
scikit-learn:mainfrom
lorentzenchr:mnt_pa_removal
Nov 2, 2026
Merged

lesteve merged 8 commits into
scikit-learn:mainfrom
lorentzenchr:mnt_pa_removal

Conversation

@lorentzenchr

Copy link
Copy Markdown
Member

Reference Issues/PRs

#29097

What does this implement/fix? Explain your changes.

This PR removes PassiveAggressiveClassifier and PassiveAggressiveRegressor, but keeps an example in SGD* estimators on how to achieve PA. Also, the entry in the User Guide under linear models is left.

AI usage disclosure

I used AI assistance for:

  • Research and understanding

Any other comments?

What to do with old changelog entries that keep references to the removed estimators?

@lesteve lesteve left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

# Passive-Aggressive classifier, special case of SGDClassifier


class MyPassiveAggressive(ClassifierMixin):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give a high-level overview why you think it is worth having this additional test?

I am kind of following this is to make sure that the SGDRegressor/Classifier with the right parameter does the same thing as a simplified custom reference class PassiveAggressive but my gut instinct is telling me:

  • "is it really worth it?"
  • "is this behaviour really not tested anywhere else already?"

An agent seems to agree with you saying that these tests are equivalent to the old PassiveAggressive ones, but you know sometimes I prefer asking a human, I know I am weird 😜

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would not be tested otherwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes I prefer asking a human, I know I am weird

no, you‘re human

@lesteve

lesteve commented Oct 28, 2026

Copy link
Copy Markdown
Member

What to do with old changelog entries that keep references to the removed estimators?

I would keep them, unless you see a big problem with this?

@lesteve

lesteve commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Can you also push a [doc build] commit to make sure that the doc build produces no warning. I am now thinking that you can get warnings turned into errors because of `:class:`linear_model.PassiveAggressiveRegressor` references in old changelogs. I am not 100% sure though

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @lorentzenchr!

Just some minor issues with the documentation. Otherwise, LGTM!

Comment thread doc/modules/linear_model.rst Resolved
Comment thread doc/modules/linear_model.rst Resolved
Comment thread sklearn/linear_model/_sgd_fast.pyx.tp Resolved
@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Oct 29, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Oct 29, 2026
@lesteve

lesteve commented Nov 2, 2026

Copy link
Copy Markdown
Member

Thanks for the updates and pushing a commit with [doc build].

The CircleCI error looks unrelated something failing because the Wikipedia dataset can not be downloaded somehow from build log


    Unexpected failing examples (1):
    
        ../examples/applications/plot_wikipedia_principal_eigenvector.py failed leaving traceback:
    
        Traceback (most recent call last):
          File "/home/circleci/project/examples/applications/plot_wikipedia_principal_eigenvector.py", line 47, in <module>
            redirects_filename = fetch_file(redirects_url)
          File "/home/circleci/project/sklearn/datasets/_base.py", line 1594, in fetch_file
            return _fetch_remote(
                remote_metadata, dirname=folder, n_retries=n_retries, delay=delay
            )
          File "/home/circleci/project/sklearn/datasets/_base.py", line 1462, in _fetch_remote
            urlretrieve(remote.url, temp_file_path)
            ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 212, in urlretrieve
            with contextlib.closing(urlopen(url, data)) as fp:
                                    ~~~~~~~^^^^^^^^^^^
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 187, in urlopen
            return opener.open(url, data, timeout)
                   ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 487, in open
            response = self._open(req, data)
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 504, in _open
            result = self._call_chain(self.handle_open, protocol, protocol +
                                      '_open', req)
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 464, in _call_chain
            result = func(*args)
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 1381, in https_open
            return self.do_open(http.client.HTTPSConnection, req,
                   ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                context=self._context)
                                ^^^^^^^^^^^^^^^^^^^^^^
          File "/home/circleci/miniforge3/envs/testenv/lib/python3.14/urllib/request.py", line 1336, in do_open
            raise URLError(err)
        urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
    
    -------------------------------------------------------------------------------

@lesteve
lesteve enabled auto-merge (squash) November 2, 2026 15:51
@lesteve

lesteve commented Nov 2, 2026

Copy link
Copy Markdown
Member

I enabled auto-merge and clicked on the "Update branch button" so this PR will be merged automatically.

One of the rare exception when I think it's fine for me to push into your branch @lorentzenchr 😉! If it's not fine, do let me know of course!

@lesteve
lesteve merged commit 4dc45d9 into scikit-learn:main Nov 2, 2026
36 checks passed
@lorentzenchr
lorentzenchr deleted the mnt_pa_removal branch November 2, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants