Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ scipy
scikit-learn
update_checker
tqdm
stopit
pandas
joblib
xgboost
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ dependencies = [
"scikit-learn>=1.6",
"update_checker>=0.16",
"tqdm>=4.36.1",
"stopit>=1.1.1",
"pandas>=2.2.0",
"joblib>=1.1.1",
"xgboost>=3.0.0",
Expand Down
46 changes: 0 additions & 46 deletions tpot/utils/eval_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
import traceback
from collections.abc import Iterable
import warnings
from stopit import threading_timeoutable, TimeoutException
from tpot.selectors import survival_select_NSGA2
import time
import dask
import stopit
from dask.diagnostics import ProgressBar
from tqdm.dask import TqdmCallback
from dask.distributed import progress
Expand Down Expand Up @@ -269,47 +267,3 @@ def parallel_eval_objective_list(individual_list,
final_scores = process_scores(final_scores, n_expected_columns)
return final_scores, final_start_times, final_end_times, final_eval_errors


###################
# Parallel optimization
#############

@threading_timeoutable(np.nan) #TODO timeout behavior
def optimize_objective(ind, objective, steps=5, verbose=0):

with warnings.catch_warnings(record=True) as w: #catches all warnings in w so it can be supressed by verbose
try:
value = ind.optimize(objective, steps=steps)
if not isinstance(value, Iterable):
value = [value]

if len(w) and verbose>=2:
warnings.warn(w[0].message)
return value
except Exception as e:
if verbose >= 2:
print('WARNING THIS INDIVIDUAL CAUSED AND EXCEPTION')
print(e)
print()
if verbose >= 3:
print(traceback.format_exc())
print()
return [np.nan]



def parallel_optimize_objective(individual_list,
objective,
n_jobs = 1,
verbose=0,
steps=5,
timeout=None,
**objective_kwargs, ):

Parallel(n_jobs=n_jobs)(delayed(optimize_objective)(ind, objective, steps, verbose, timeout=timeout) for ind in individual_list ) #TODO: parallelize