Skip to content

fix: replace deprecated sklearn PassiveAggressive estimators - #400

Open
tachyonicClock wants to merge 3 commits into
adaptive-machine-learning:mainfrom
tachyonicClock:fix/sklearn-passive-aggressive-deprecation
Open

fix: replace deprecated sklearn PassiveAggressive estimators#400
tachyonicClock wants to merge 3 commits into
adaptive-machine-learning:mainfrom
tachyonicClock:fix/sklearn-passive-aggressive-deprecation

Conversation

@tachyonicClock

@tachyonicClock tachyonicClock commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Fixes adaptive-machine-learning/backlog#137:

FutureWarning: Class PassiveAggressiveClassifier is deprecated; this is deprecated in
version 1.8 and will be removed in 1.10.

Had to bump the python version 3.10 to 3.11 to use a newer version of sklearn to have the same features. This is a good idea because python 3.0 is end of life 2026.

Assisted-by: claude-code:claude-opus-5

Comment thread tests/test_datasets.py
Comment thread pyproject.toml
…ve estimators

scikit-learn 1.8 deprecated PassiveAggressiveClassifier and
PassiveAggressiveRegressor, and will remove them in 1.10. Both wrappers
now build on SGDClassifier/SGDRegressor with the passive aggressive
learning rate schedule, which is what the deprecated classes used
internally: hinge/epsilon_insensitive maps to "pa1" (PA-I) and the
squared variants map to "pa2" (PA-II), with C passed as eta0.

The CapyMOA API is unchanged. Since the loss no longer selects the
variant on its own, `loss` is now validated and typed as a Literal.
Verified that the resulting coef_ and intercept_ are identical to the
deprecated estimators for all four losses.

Requires scikit-learn 1.8, which introduced the "pa1"/"pa2" schedules.

Assisted-by: claude-code:claude-opus-5
Python 3.14 makes filter="data" the default for tar extraction and warns
until then, so downloading any tar dataset raised a DeprecationWarning.
Request the filter explicitly: it also rejects members that would escape
the download directory. The zip unpacker takes no filter, so only tar
formats get one.

Assisted-by: claude-code:claude-opus-5
Add 3.13 to the release matrix and drop 3.10, which cannot be kept:
scikit-learn 1.8 is needed for the passive aggressive learning rates and
requires Python 3.11 or newer. The full suite passes on 3.11 and 3.13.

Assisted-by: claude-code:claude-opus-5
@tachyonicClock
tachyonicClock force-pushed the fix/sklearn-passive-aggressive-deprecation branch from 20a3a89 to 5d820b4 Compare August 20, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant