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

Early crash fix #1315

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Early crash fix #1315

merged 2 commits into from
Aug 14, 2023

Conversation

perib
Copy link
Contributor

@perib perib commented Aug 12, 2023

[please review the Contribution Guidelines prior to submitting your pull request. go ahead and delete this line if you've already reviewed said guidelines.]

What does this PR do?

I believe this addresses the cause of the issue described in #1313 and #1308.

The issue in in line 134 and 137 of gp_deap.py

Original

if ind1 is not None:
                ind1, _ = toolbox.mate(ind1, ind2)
                del ind1.fitness.values

bugged

if ind1 is not None:
                ind1_cx, _, evaluated_individuals_= toolbox.mate(ind1, ind2)
                del ind1.fitness.values

fixed

if ind1 is not None:
                ind1_cx, _, evaluated_individuals_= toolbox.mate(ind1, ind2)
                del ind1_cx.fitness.values

In commit 9e6ad7e line 134 was changed to rename ind1 to ind1_cx.
However the following line was not changed to rename ind1 to ind1_cx. So rather than deleting the values for the new individual, it was deleting the scores for the old individual. likely triggering the error identified by @Lingepumpe in #1308

How should this PR be tested?

I used the following code to reproduce the behavior. It doesn't happen all of the time, needs to be rerun a few times to recreate the problem. The issue does not seem to happen with the fixed version.

from tpot import TPOTRegressor
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
import pandas as pd
import numpy as np
import sklearn.datasets

X, y = sklearn.datasets.make_regression(n_samples=100)

est = TPOTRegressor(generations=50, population_size=28, cv=2, verbosity=2, random_state=42, n_jobs=-2)

est.fit(X,y)

What are the relevant issues?

#1313 #1308

@perib perib requested a review from jay-m-dev August 12, 2023 00:14
@jay-m-dev jay-m-dev merged commit 06323a1 into EpistasisLab:master Aug 14, 2023
@perib perib deleted the early_crash_fix branch August 14, 2023 21:50
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

Successfully merging this pull request may close these issues.

2 participants