Skip to content

fix: best_model_for_estimator returns inconsistent feature_importances_ compared to automl.model#1429

Merged
thinkall merged 7 commits into
microsoft:mainfrom
murunlin:mrl-issue1422
May 15, 2025
Merged

fix: best_model_for_estimator returns inconsistent feature_importances_ compared to automl.model#1429
thinkall merged 7 commits into
microsoft:mainfrom
murunlin:mrl-issue1422

Conversation

@murunlin
Copy link
Copy Markdown
Collaborator

@murunlin murunlin commented May 13, 2025

Why are these changes needed?

These changes address the issue with inconsistent feature_importances_, proposed by issue #1422
In previous versions:
the best model for each estimator stored in _search_states, the function best_model_for_estimator() returns model in _search_states without checking whether it matches the final best model, so it may return intermediate result.

This modification:
when the estimator matches the automl.best_estimator, directly return automl.model, which ensure the consistency between two feature_importances_ attributes.

Related issue number

Related to #1422

Checks

@murunlin murunlin marked this pull request as ready for review May 13, 2025 08:32
Copy link
Copy Markdown
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

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

Thank you, @murunlin, for the PR! LGTM. There are some test failures, please help fix them.

Runlin Mu (FESCO Adecco Human Resources) added 2 commits May 13, 2025 21:29
Comment thread .github/workflows/python-package.yml Outdated
Copy link
Copy Markdown
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM.

@thinkall thinkall merged commit 0f94205 into microsoft:main May 15, 2025
16 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