Skip to content

fix: LRL2Classifier honors random_seed config#1552

Merged
thinkall merged 1 commit into
microsoft:mainfrom
immu4989:flaml-fix-lrl2-reproducibility
May 21, 2026
Merged

fix: LRL2Classifier honors random_seed config#1552
thinkall merged 1 commit into
microsoft:mainfrom
immu4989:flaml-fix-lrl2-reproducibility

Conversation

@immu4989
Copy link
Copy Markdown
Contributor

@immu4989 immu4989 commented May 21, 2026

Why are these changes needed?

Seed random_state on LRL2Classifier.__init__ for consistency with the rest of the audited estimator family (CatBoost, ElasticNet, LinearSVC, SGD, LRL1, RandomForest, ExtraTrees, all XGBoost variants).

LRL2Classifier's default solver is lbfgs, which is deterministic, so the existing lrl2 reproducibility tests have always passed — but issue #1540 flagged this class as "relevant for sag/saga" solvers. Users who override solver="sag" or solver="saga" via config get a stochastic solver today that doesn't honor the FLAML-internal random_seed. This change closes that edge case using the same defensive pattern shipped in #1541, #1546, #1547, #1549, and #1551.

This is the final estimator in tracking issue #1540. With this merged, every random_state-accepting estimator in flaml/automl/model.py (sklearn family) consistently honors the FLAML random_seed config.

Related issue number

Closes #1540
Pattern reference: #1541 (SGD), #1546 (LRL1), #1547 (RandomForest), #1549 (XGBoost-sklearn), #1551 (XGBoost-native)

Checks

@thinkall thinkall merged commit c8f4763 into microsoft:main May 21, 2026
13 checks passed
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.

Reproducibility audit: remaining estimators (follow-up to #1364, #1369, #1374, #1376)

2 participants