Skip to content

Commit 0f94205

Browse files
murunlinRunlin Mu (FESCO Adecco Human Resources)thinkall
authored
fix: best_model_for_estimator returns inconsistent feature_importances_ compared to automl.model (#1429)
* mrl-issue1422-0513 * fix version dependency * fix datasets version * test completion --------- Co-authored-by: Runlin Mu (FESCO Adecco Human Resources) <v-runlinmu@microsoft.com> Co-authored-by: Li Jiang <bnujli@gmail.com>
1 parent 5107c50 commit 0f94205

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

flaml/automl/automl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ def best_model_for_estimator(self, estimator_name: str):
424424
If `model_history` was set to True, then the returned model is trained.
425425
"""
426426
state = self._search_states.get(estimator_name)
427+
if state and estimator_name == self._best_estimator:
428+
return self.model
427429
return state and getattr(state, "trained_estimator", None)
428430

429431
@property

0 commit comments

Comments
 (0)