Skip to content

Commit

Permalink
fix: Adding back the LGBM EarlyStopping
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Grindrod authored and Daniel Grindrod committed Oct 29, 2024
1 parent d43b8c1 commit 654194d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flaml/automl/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,8 @@ def _callback(self, start_time, deadline, free_mem_ratio, env) -> None:
now = time.time()
if env.iteration == 0:
self._time_per_iter = now - start_time
if now + self._time_per_iter > deadline:
raise EarlyStopException(env.iteration, env.evaluation_result_list)
if psutil is not None:
mem = psutil.virtual_memory()
if mem.available / mem.total < free_mem_ratio:
Expand Down

0 comments on commit 654194d

Please sign in to comment.