运行GridSearchCV时内核不断消亡

时间:2019-05-15 21:14:09

标签: python-3.x jupyter-notebook regression random-forest gridsearchcv

我试图使用GridSearchCV为我的RandomForestRegressor找到最佳参数,但是每次我运行以下代码时,内核都会在Jupiter笔记本中死亡。我有什么可以做的吗?

'''python 清晰度调整(估算器,X,标签,网格,one_by_one = False):

data=Data(X, label)

if one_by_one:
    extra_cl_random = GridSearchCV(estimator=estimator, param_grid=grid)

else:
    extra_cl_random = RandomizedSearchCV(estimator=estimator, param_distributions=grid, n_iter=500, cv=3)

extra_cl_random.fit(*data.train())

best = extra_cl_random.best_estimator_
tscore = best.score(*data.train())
vscore = best.score(*data.valid())
params = best.get_params()

print('vscore:', vscore)
print('best_params:', params) 

调整(RandomForestRegressor(),列,标签,random_grid) '''

我收到的消息是“内核似乎已经死亡。它将自动重新启动。”

0 个答案:

没有答案
相关问题