问题描述
我使用 Python 3 中的 XGBoost 库创建了一个梯度提升模型。该模型是针对特定电信数据集的分类模型。
结果如下。
searching domain
{"learning_rate" : [0.05,0.10],"max_depth" : [ 5,6,8],"min_child_weight" : [ 1,3,5],"gamma" : [0.1],"colsample_bytree" : [ 0.3,0.4 ],"n_estimators" : [10,9],"objective" : ['binary:logistic'],"eval_metric" : ['error']}
Best score: 0.846148908841385
Best arguments: {'colsample_bytree': 0.4,'eval_metric': 'error','gamma': 0.1,'learning_rate': 0.05,'max_depth': 6,'min_child_weight': 1,'n_estimators': 10,'objective': 'binary:logistic'}
score on train data: 0.8805998860989313
score on test data: 0.8364520807988984
confusion matrix
[[1417 107]
[ 329 260]]
y_test to y_pred roc_crv
precision recall f1-score support
0 0.81 0.93 0.87 1524
1 0.71 0.44 0.54 589
accuracy 0.79 2113
macro avg 0.76 0.69 0.71 2113
weighted avg 0.78 0.79 0.78 2113
img
但我不明白为什么 f1 分数与测试数据集的分数不同。为什么会出现这种差异?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)