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

Dev #125

Merged
merged 17 commits into from
Apr 19, 2024
Merged

Dev #125

Changes from 1 commit
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
Prev Previous commit
Next Next commit
multiobjective correction
  • Loading branch information
nickmatsumoto committed Mar 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ac61118f7f8eb2aa5111d5b39c08ddf8b1762447
14 changes: 6 additions & 8 deletions tpot2/utils/eval_utils.py
Original file line number Diff line number Diff line change
@@ -181,22 +181,22 @@ def parallel_eval_objective_list2(individual_list,
if completed_future.exception() or completed_future.status == "error": #if the future is done and threw an error
print("Exception in future")
print(completed_future.exception())
scores = [np.nan]
scores = [np.nan for _ in range(n_expected_columns)]
eval_error = "INVALID"
elif completed_future.cancelled(): #if the future is done and was cancelled
print("Cancelled future (likely memory related)")
scores = [np.nan]
scores = [np.nan for _ in range(n_expected_columns)]
eval_error = "INVALID"
else: #if the future is done and did not throw an error, get the scores
try:
scores = completed_future.result()
#check if scores contain "INVALID" or "TIMEOUT"
if "INVALID" in scores:
eval_error = "INVALID"
scores = [np.nan]
scores = [np.nan for _ in range(n_expected_columns)]
elif "TIMEOUT" in scores:
eval_error = "TIMEOUT"
scores = [np.nan]
scores = [np.nan for _ in range(n_expected_columns)]
else:
eval_error = None

@@ -208,7 +208,7 @@ def parallel_eval_objective_list2(individual_list,
print("status", completed_future.status)
print("done", completed_future.done())
print("cancelld ", completed_future.cancelled())
scores = [np.nan]
scores = [np.nan for _ in range(n_expected_columns)]
eval_error = "INVALID"
else: #if future is not done

@@ -219,7 +219,7 @@ def parallel_eval_objective_list2(individual_list,
if verbose >= 4:
print(f'WARNING AN INDIVIDUAL TIMED OUT (Fallback): \n {submitted_futures[completed_future]} \n')

scores = [np.nan]
scores = [np.nan for _ in range(n_expected_columns)]
eval_error = "TIMEOUT"
else:
continue #otherwise, continue to next future
@@ -251,9 +251,7 @@ def parallel_eval_objective_list2(individual_list,
final_start_times = [scores_dict[individual]["start_time"] for individual in individual_list]
final_end_times = [scores_dict[individual]["end_time"] for individual in individual_list]
final_eval_errors = [scores_dict[individual]["eval_error"] for individual in individual_list]

final_scores = process_scores(final_scores, n_expected_columns)

return final_scores, final_start_times, final_end_times, final_eval_errors


Loading