Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading docstrings for TPOTEstimator.max_eval_time_mins & max_time_mins #169

Open
chimaerase opened this issue Feb 12, 2025 · 0 comments

Comments

@chimaerase
Copy link

chimaerase commented Feb 12, 2025

In 0.1.9a0, and by inspection, also in master, the docstring for TPOTEstimator.max_eval_time_mins indicates that a float, including float("inf") is accepted, and also documents a default value that doesn't match the default set in the __init__() signature. Defaults should be ideally be auto-detected via mkdocs or similar infrastructure, not entered / maintained by busy & distractible humans. It also appears that the default is masking an internal problem in how this value is processed.

I've verified on the LOC just prior to creating a TPOTEstimator (first line of output below) that my max_eval_time_mins is float("inf"), but I still get an error. It appears that the default parameter value in __init__() is likely masking an internal inconsistency in how this is treated. There's a similarly misleading docstring re: default value for max_time_mins though I haven't explicitly tested that.

It seems likely that similar documentation maintenance issues are pervasive within the codebase, though I haven't taken the time to explicitly verify.

Creating TPOTEstimator.  max_eval_time_mins = inf, max_time_mins = inf
Generation:   0%|                                                                                                                                                                                         | 0/100 [00:00<?, ?it/s]Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  [censored lines from my private code]
    estimator.fit(X, y)  # Use genetic algorithm to explore hyperparameter space
    ^^^^^^^^^^^^^^^^^^^
  File "/home/user/.venv/lib/python3.11/site-packages/tpot2/tpot_estimator/estimator.py", line 763, in fit
    self._evolver_instance.optimize()
  File "/home/user/.venv/lib/python3.11/site-packages/tpot2/evolvers/base_evolver.py", line 499, in optimize
    self.evaluate_population()
  File "/home/user/.venv/lib/python3.11/site-packages/tpot2/evolvers/base_evolver.py", line 685, in evaluate_population
    self.evaluate_population_full(budget=self.budget)
  File "/home/user/.venv/lib/python3.11/site-packages/tpot2/evolvers/base_evolver.py", line 717, in evaluate_population_full
    scores, start_times, end_times, eval_errors = tpot2.utils.eval_utils.parallel_eval_objective_list(individuals_to_evaluate, self.objective_functions, verbose=self.verbose, max_eval_time_mins=self.max_eval_time_mins, budget=budget, n_expected_columns=len(self.objective_names), client=self._client, scheduled_timeout_time=self.scheduled_timeout_time, **self.objective_kwargs)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.venv/lib/python3.11/site-packages/tpot2/utils/eval_utils.py", line 133, in parallel_eval_objective_list
    future = client.submit(eval_objective_list, individual,  objective_list, verbose=verbose, timeout=max_eval_time_mins*60,**objective_kwargs)
                                                                                                      ~~~~~~~~~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
@chimaerase chimaerase changed the title Misleading docstrings for TPOTEstimater.max_eval_time_mins & max_time_mins Misleading docstrings for TPOTEstimator.max_eval_time_mins & max_time_mins Feb 12, 2025
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

No branches or pull requests

1 participant