Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 运行RandomizedSearchCV调整LightGBM回归器以获得大数据_Python 3.x_Tensorflow_Cpu Usage_Grid Search_Lightgbm - Fatal编程技术网

Python 3.x 运行RandomizedSearchCV调整LightGBM回归器以获得大数据

Python 3.x 运行RandomizedSearchCV调整LightGBM回归器以获得大数据,python-3.x,tensorflow,cpu-usage,grid-search,lightgbm,Python 3.x,Tensorflow,Cpu Usage,Grid Search,Lightgbm,我正在训练一个LightGBM回归模型,用于一个大约300万点的数据集,其中包含22个特征。我正在尝试使用RandomizedSearchCV调整模型超参数。这需要很长时间。我在谷歌云上使用一个虚拟机,有24个CPU核心和32G内存 当我尝试使用所有CPU内核进行随机搜索时,或者大多数CPU内核如下所示: # Use the random grid to search for best hyperparameters # First create the base model to tune l

我正在训练一个LightGBM回归模型,用于一个大约300万点的数据集,其中包含22个特征。我正在尝试使用RandomizedSearchCV调整模型超参数。这需要很长时间。我在谷歌云上使用一个虚拟机,有24个CPU核心和32G内存

当我尝试使用所有CPU内核进行随机搜索时,或者大多数CPU内核如下所示:

# Use the random grid to search for best hyperparameters
# First create the base model to tune
lgbm = lgb.LGBMRegressor()
# Random search of parameters, using 2 fold cross validation, 
# search across 100 different combinations, and use all available cores
lgbm_random = RandomizedSearchCV(estimator = lgbm, param_distributions = random_grid, 
                         n_iter = 100, cv = 2, scoring='neg_mean_absolute_error',
                          verbose=10, random_state=42, n_jobs = 18)
它将以以下错误停止:

由执行者管理的工作进程意外终止。这可能是由于在运行时出现分段错误造成的 调用函数或通过过度内存使用导致 操作系统来杀死工人。工人的出口代码为 {SIGKILL(-9)}

如何使用所有CPU内核正常执行此操作


在GPU上而不是CPU上运行随机搜索有什么不同吗?有多少个GPU内核适合做这项工作?

我认为你应该从
随机搜索CV
中删除
n\u作业
,这样就能解决问题。您可以在LightGBM hyper参数中指定
num_线程
,以使用并行学习(这是LGB中
n_作业
别名

,不建议使用机器的所有线程。您应该使用比您的CPU核心线程更少的东西

对于并行学习,不要使用所有CPU核,因为这样会 导致网络通信性能差