我正在嘗試使用multi:softmax
目標來訓練xgboost模型,但準確性分數卡住了。如何更改參數以防止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,但徒勞無功。