Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicl-nno committed Jul 2, 2024
1 parent 73ec061 commit df022e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fedot/api/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self, **time_params):
self.tuning_spend_time = datetime.timedelta(minutes=0)

self.assumption_fit_spend_time = datetime.timedelta(minutes=0)
self.assumption_fit_spend_time_single_fold = datetime.timedelta(minutes=0)

def __define_timeouts_for_stages(self):
""" Determine timeouts for tuning and composing """
Expand Down Expand Up @@ -73,15 +74,17 @@ def launch_assumption_fit(self, n_folds: int):
""" Wrap assumption fit process with timer """
starting_time_for_assumption_fit = datetime.datetime.now()
yield
self.assumption_fit_spend_time = (datetime.datetime.now() - starting_time_for_assumption_fit) * n_folds
self.assumption_fit_spend_time_single_fold = \
(datetime.datetime.now() - starting_time_for_assumption_fit) * n_folds
self.assumption_fit_spend_time = self.assumption_fit_spend_time_single_fold * n_folds

def determine_resources_for_tuning(self):
"""
Based on time spend for composing and initial pipeline fit determine
how much time and how many iterations are needed for tuning
"""
all_spend_time = self.composing_spend_time + self.assumption_fit_spend_time
all_spend_time = self.composing_spend_time + self.assumption_fit_spend_time_single_fold

if self.time_for_automl is not None:
all_timeout = float(self.time_for_automl)
Expand Down

0 comments on commit df022e3

Please sign in to comment.