卡在 jupyter 笔记本中

问题描述

我是机器学习的新手,我开始关注此 tutorial 以了解员工流失。我按照步骤操作,但我的代码卡在 20 以下的那个单元格上。我唯一改变的是删除 idd 参数,但它适用于它上面的那个,而不是这个。

Image of Code

rf_classifier = RandomForestClassifier(class_weight = "balanced",random_state=7)
param_grid = {'n_estimators': [50,75,100,125,150,175],'min_samples_split':[2,4,6,8,10],'min_samples_leaf': [1,2,3,4],'max_depth': [5,10,15,20,25]}

grid_obj = gridsearchcv(rf_classifier,return_train_score=True,param_grid=param_grid,scoring='roc_auc',cv=10)

grid_fit = grid_obj.fit(X_train,y_train)
rf_opt = grid_fit.best_estimator_

print('='*20)
print("best params: " + str(grid_obj.best_estimator_))
print("best params: " + str(grid_obj.best_params_))
print('best score:',grid_obj.best_score_)
print('='*20)

Github Link for the project I am following.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)