使用 Python tpot 配置 njobs
Configuring njobs with Python tpot
是否可以在代码中使用 tpot 配置 njobs 参数而不是作为命令行参数传递?
阅读 https://rhiever.github.io/tpot/using/ 状态:
-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.
但是如何在代码中配置这个参数?
正在尝试:
TPOTClassifier(generations=5, verbosity=3, config_dict='TPOT light' , NUM_JOBS = 4)
returns 错误:
TPOTClassifier(generations=5, verbosity=3, config_dict='TPOT light' , NUM_JOBS = 4)
TypeError: __init__() got an unexpected keyword argument 'NUM_JOBS'
使用n_jobs
参数实现:
TPOTClassifier(
generations=5,
verbosity=3,
config_dict='TPOT light',
n_jobs=4
)
是否可以在代码中使用 tpot 配置 njobs 参数而不是作为命令行参数传递?
阅读 https://rhiever.github.io/tpot/using/ 状态:
-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.
但是如何在代码中配置这个参数?
正在尝试:
TPOTClassifier(generations=5, verbosity=3, config_dict='TPOT light' , NUM_JOBS = 4)
returns 错误:
TPOTClassifier(generations=5, verbosity=3, config_dict='TPOT light' , NUM_JOBS = 4)
TypeError: __init__() got an unexpected keyword argument 'NUM_JOBS'
使用n_jobs
参数实现:
TPOTClassifier(
generations=5,
verbosity=3,
config_dict='TPOT light',
n_jobs=4
)