我正在尝试使用multi:softmax
目标训练 xgboost 模型,但准确度得分卡住了。
代码:
#preparing dataset omitted
xgb_params = {
"objective": "multi:softmax",
"eta": 1,
"num_class": 62,
"max_depth": 10,
"nthread": 4,
"eval_metric": "merror",
"print.every.n": 1,
"silent": 1,
"early.stop.round": 5
}
num_rounds = 5
mask = np.random.choice([False, True], len(X_train), p=[0.5, 0.5])
not_mask = [not i for i in mask]
dtrain = xgb.DMatrix(X_train[not_mask], label=y[not_mask])
dtrain_watch = xgb.DMatrix(X_train[mask], label=y[mask])
dtest = xgb.DMatrix(X_test)
watchlist = [(dtrain_watch, 'eval')]
gbdt = xgb.train(xgb_params, dtrain, num_rounds, watchlist)
preds = gbdt.predict(dtest)
输出:
[0] eval-merror:0.989950
[1] eval-merror:0.989950
[2] eval-merror:0.989950
[3] eval-merror:0.989950
[4] eval-merror:0.989950
我需要更改哪些参数以反映迭代中的任何更改 eval-merror?
编辑:我试图将 eta 更改为 0.01、0.1、0.3 和 1,但徒劳无功。