tpot crashes when entering negative numbers in n_jobs

Created on 12 Mar 2019  路  4Comments  路  Source: EpistasisLab/tpot

if I want to set more negative numbers than -1 the tpop pipeline returns the following:

Optimization Progress:   0%|          | 0/3030 [00:00<?, ?pipeline/s]

Traceback (most recent call last):
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 646, in fit
    per_generation_function=self._check_periodic_pipeline
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\gp_deap.py", line 227, in eaMuPlusLambda
    population = toolbox.evaluate(population)
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 1277, in _evaluate_individuals
    ind.fitness.values = (self.evaluated_individuals_[ind_str]['operator_count'],
KeyError: 'KNeighborsClassifier(input_matrix, KNeighborsClassifier__n_neighbors=62, KNeighborsClassifier__p=2, KNeighborsClassifier__weights=distance)'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\IPython\core\interactiveshell.py", line 3291, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-474670f1801d>", line 1, in <module>
    runfile('C:/Users/Omar/OneDrive - Massachusetts Institute of Technology/decoding/2019 for motion color modelling/tpot_optima.py', wdir='C:/Users/Omar/OneDrive - Massachusetts Institute of Technology/decoding/2019 for motion color modelling')
  File "C:\Program Files\JetBrains\PyCharm 2018.3.5\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2018.3.5\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/Omar/OneDrive - Massachusetts Institute of Technology/decoding/2019 for motion color modelling/tpot_optima.py", line 171, in <module>
    pipeline_optimizer.fit(X_train, y_train)
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 678, in fit
    raise e
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 669, in fit
    self._update_top_pipeline()
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 743, in _update_top_pipeline
    raise RuntimeError('A pipeline has not yet been optimized. Please call fit() first.')
RuntimeError: A pipeline has not yet been optimized. Please call fit() first.


enhancement

Most helpful comment

Hmm, I think it is a good option, which is similar with n_jobs in scikit-learn. We will add this option into next version of TPOT.

All 4 comments

The n_jobs parameter should only be a positive integer or -1.

why not less than -1? this implies that I want to reserve some CPUs for general use and the other ones used in parallel here

Hmm, I think it is a good option, which is similar with n_jobs in scikit-learn. We will add this option into next version of TPOT.

I close this issue because it is fixed in master branch. Please feel free to reopen it if there is other related issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

100330706 picture 100330706  路  5Comments

skrish13 picture skrish13  路  3Comments

stokjakub picture stokjakub  路  3Comments

fferroni picture fferroni  路  4Comments

windowshopr picture windowshopr  路  4Comments