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

Use stopit module for timeout function #509

Merged
merged 7 commits into from
Jun 27, 2017

Conversation

weixuanfu
Copy link
Contributor

What does this PR do?

  1. Remove Interruptable_cross_val_score class since it cannot stop thread cleanly.

  2. stopit module can raise a Exception in a working thread for stopping thread and has a better decorator for timeout function

  3. Because Ctrl + C works with n_jobs is not 1 in Windows OS after usingstopit module, the related warning message was removed

Where should the reviewer start?

gp_deap.py

How should this PR be tested?

Any TPOT examples

What are the relevant issues?

#508

Questions:

  • Do the docs need to be updated? Yes, updated in the PR
  • Does this PR add new (Python) dependencies? Yes, need stopit module

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 86.922% when pulling 03eed0d on weixuanfu2016:stopit into 7f2b6a7 on rhiever:development.

@weixuanfu
Copy link
Contributor Author

weixuanfu commented Jun 26, 2017

Update:

After more tests, freezing issue #436 and #422 are also fixed somehow in Windows OS (~6s/pipeline) using test codes below. But for Linux OS, it is ~22s/pipeline.

# coding: utf-8
from sklearn.datasets import make_classification
from tpot import TPOTClassifier
# make a huge dataset
X, y = make_classification(n_samples=50000, n_features=200,
                                    n_informative=20, n_redundant=20,
                                    n_classes=5, random_state=42)

# max_eval_time_mins=0.1 means 6 seconds limits for evaluating a single pipeline 
tpot = TPOTClassifier(generations=5, population_size=50, offspring_size=100, random_state=42, n_jobs=1, max_eval_time_mins=0.1, verbosity=3) 
tpot.fit(X, y)

@rhiever
Copy link
Contributor

rhiever commented Jun 26, 2017

Future note (also to @teaearlgraycold): Please don't rebuild the docs in future PRs. That's an easy way to get ugly merge conflicts.

@weixuanfu
Copy link
Contributor Author

OK, I will restore changes in docs.

This reverts commit bbe45b1.
@weixuanfu
Copy link
Contributor Author

Changes in docs was reverted.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 86.922% when pulling e27059b on weixuanfu2016:stopit into 7f2b6a7 on rhiever:development.

@rhiever rhiever merged commit b1c618d into EpistasisLab:development Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants