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

Improve error message #1338

Merged
merged 1 commit into from
Feb 22, 2024
Merged

Improve error message #1338

merged 1 commit into from
Feb 22, 2024

Conversation

gatl
Copy link
Contributor

@gatl gatl commented Dec 12, 2023

Unfortunately there is no fine granularity when an error occurs. That makes it more relevant to list as many possibilities for the causes as possible. In this patch, one additional cause is added to the ones already presented (no optimization done due to timeout from max_eval_time_mins).

What does this PR do?

Presents one additional cause to the exception that the user may get. It took me some time to understand the error and this may save other people from this work.

Where should the reviewer start?

Review the change to the message.

How should this PR be tested?

No testing needed, just validate the change to the test.

Any background context you want to provide?

It took me many hours of work to figure out why this RuntimeError was being raised. Hopefully, others in the same situation can diagnose their situation in less time.

What are the relevant issues?

No relevant issues that I am aware of.

Screenshots (if appropriate)

It is not.

Questions:

  • Do the docs need to be updated?
    No, there is no need to do so. However, there is no mention of what happens when the timeouts are reached. The present RuntimeError may not be the full story, so I will leave this chore to someone with greater familiarity with the code.

  • Does this PR add new (Python) dependencies?
    No additional dependency is added.

Unfortunately there is no fine granularity when an error occurs. That makes it more relevant to list as many possibilities for the causes as possible.
In this patch, one additional cause is added to the ones already presented (no optimization done due to timeout from max_eval_time_mins).
@jay-m-dev jay-m-dev self-requested a review February 22, 2024 18:42
Copy link
Contributor

@jay-m-dev jay-m-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to trigger this RuntimeError with:
`from tpot import TPOTClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
import numpy as np

breast_cancer = load_breast_cancer()
X_train, X_test, y_train, y_test = train_test_split(breast_cancer.data.astype(np.float64),
breast_cancer.target.astype(np.float64), train_size=0.75, test_size=0.25, random_state=42)

est = TPOTClassifier(generations=5, population_size=50, verbosity=2, random_state=42, max_eval_time_mins=0.0001)
est.fit(X_train, y_train)`

But also had to update the timeout var set in base.py.

@jay-m-dev jay-m-dev merged commit 3fd4e9b into EpistasisLab:master Feb 22, 2024
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