2

Can the njobs parameter be configured using tpot within code and not passed as command line parameter ?

Reading https://rhiever.github.io/tpot/using/ states :

-njobs  NUM_JOBS    Any positive integer or -1  Number of CPUs for evaluating pipelines in parallel during the TPOT optimization process. 

Assigning this to -1 will use as many cores as available on the computer.

But how to configure this parameter within code ?

Trying :

TPOTClassifier(generations=5, verbosity=3,  config_dict='TPOT light' , NUM_JOBS = 4)  

returns error :

TPOTClassifier(generations=5, verbosity=3,  config_dict='TPOT light' , NUM_JOBS = 4)
TypeError: __init__() got an unexpected keyword argument 'NUM_JOBS'
stop-cran
  • 4,229
  • 2
  • 30
  • 47
blue-sky
  • 51,962
  • 152
  • 427
  • 752

1 Answers1

1

Achieved using n_jobs parameter:

TPOTClassifier(
    generations=5,
    verbosity=3,
    config_dict='TPOT light',
    n_jobs=4
)
gosuto
  • 5,422
  • 6
  • 36
  • 57
blue-sky
  • 51,962
  • 152
  • 427
  • 752