首页 文章

如何让随机网格搜索更加冗长? (似乎已停止,但无法诊断)

提问于
浏览
2

我正在运行一个相对较大的工作,其中涉及对数据集进行随机网格搜索,该数据集(使用小的n_iter_search)已经花费很长时间 .

我'm running it on a 64 core machine, and for about 2 hours it kept 2000 threads active working on the first folds. It then stopped reporting completely into the stdout. It'的最后一次报道是: [Parallel(n_jobs=-1)]: Done 4 out of 60 | elapsed: 84.7min remaining: 1185.8min

我注意到htop几乎所有核心都是0%,这在训练随机森林时不会发生 . 没有来自该计划的反馈或错误,如果不是htop,我会认为它仍在训练中 . 这种情况以前发生过,所以这是一个反复出现的问题 . 机器完全响应,过程似乎还活着 .

我已经有了详细信息= 10.有关如何诊断RandomizedSearchCV中的内容的任何想法?

我正在做的网格搜索:

rfc = RandomForestClassifier(n_jobs = -1)param_grid = {'n_estimators':sp_randint(100,5000),'max_features':['auto',None],'min_samples_split':sp_randint(2,6)} n_iter_search = 20 CV_rfc = RandomizedSearchCV(estimator = rfc,param_distributions = param_grid,n_iter = n_iter_search,verbose = 10,n_jobs = -1)

1 回答

  • 2

    作为第一步,将 verbose 参数添加到 RandomForestClassifier 也可以让您查看搜索是否真的卡住了 . 它将显示拟合树木的进度( building tree 88 out of 100 ...) .

    我真的不知道为什么你的搜索卡住了,但考虑到删除 n_estimators 上的搜索应该使你能够在8次迭代中网格搜索你在这里指定的参数的整个空间 .

相关问题