Skip to content

fix: RandomForestEstimator honors random_seed config#1547

Merged
thinkall merged 1 commit into
microsoft:mainfrom
immu4989:reproducibility-audit-rf
May 14, 2026
Merged

fix: RandomForestEstimator honors random_seed config#1547
thinkall merged 1 commit into
microsoft:mainfrom
immu4989:reproducibility-audit-rf

Conversation

@immu4989
Copy link
Copy Markdown
Contributor

Why are these changes needed?

Migrate RandomForestEstimator from a hardcoded random_state=12032022 in config2params to the random_seed-aware pattern used by the recently fixed estimators (#1364, #1374, #1376, #1541, #1546).

Before this change, callers passing AutoML(random_seed=N).fit(...) would get the same internal RandomForest/ExtraTrees random_state (always 12032022) regardless of N , inconsistent with how CatBoostEstimator, ElasticNetEstimator, SVCEstimator, SGDEstimator, and LRL1Classifier already behave. This brings RandomForestEstimator and the inheriting ExtraTreesEstimator in line with the rest of the audited estimator family.

The default value is preserved (12032022), so the existing reproducibility tests for rf and extra_tree in test/automl/test_classification.py and test/automl/test_regression.py continue to pass unchanged.

Related issue number

Tracking issue: #1540
Pattern reference: #1541 (SGD), #1546 (LRL1)

Test plan

  • pytest test/automl/test_classification.py test/automl/test_regression.py -k "reproducibility and (rf or extra_tree)" — 8/8 pass
  • pre-commit run --files flaml/automl/model.py — all hooks pass
  • CI green on the PR

Checks

@thinkall thinkall merged commit 32176be into microsoft:main May 14, 2026
20 of 21 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.

2 participants