我已经为XGBoost开发了一个训练集,该训练集可以使用以下参数在学习之上对函数进行排名:
eta = 0.5估计量= 150 max_depth = 5目标=等级:成对 伽马= 1.0 eval = ndcg
并应用于此功能来训练:
def trainSearchModel(trainingDataPath: String, modelPath: String) = {
val trainMat: DMatrix = new DMatrix(trainingDataPath)
val round: Int = 200
val watches = new mutable.HashMap[String, DMatrix]
watches += "train" -> trainMat
watches += "test" -> trainMat
val booster = XGBoost.train(trainMat, searchParams.toMap, round, watches.toMap)
booster.saveModel(modelPath)
//crossValidation(searchParams.toMap, trainingDataPath, round)
}
数据分组的示例是:
1 0:7.71 1:0.61 2:0.01 3:3.81 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:1.01 14:0.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
1 0:7.71 1:0.61 2:0.01 3:3.61 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:1.01 14:0.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
0 0:7.60 1:0.60 2:0.00 3:2.90 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:0.00 14:1.00 15:0.00 16:0.00 17:0.00 18:0.00 19:0.00 20:0.0
1 0:7.61 1:0.61 2:0.01 3:2.11 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:1.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
1 0:5.71 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:1.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
1 0:5.71 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:1.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
1 0:5.31 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:1.01 18:0.01 19:0.01 20:0.0
1 0:5.31 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:1.01 18:0.01 19:0.01 20:0.0
0 0:4.40 1:0.40 2:0.00 3:0.00 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:0.00 14:0.00 15:0.00 16:0.00 17:1.00 18:0.00 19:0.00 20:0.0
0 0:4.40 1:0.40 2:0.00 3:0.00 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:0.00 14:0.00 15:0.00 16:0.00 17:1.00 18:0.00 19:0.00 20:0.0
1 0:3.91 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:1.01 18:0.01 19:0.01 20:0.0
1 0:3.91 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:1.01 18:0.01 19:0.01 20:0.0
1 0:3.81 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:1.01 18:0.01 19:0.01 20:0.0
1 0:3.81 1:0.41 2:0.01 3:0.01 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:0.01 15:0.01 16:0.01 17:1.01 18:0.01 19:0.01 20:0.0
0 0:4.40 1:0.30 2:0.00 3:2.90 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:0.00 14:1.00 15:0.00 16:0.00 17:0.00 18:0.00 19:0.00 20:0.0
0 0:4.40 1:0.30 2:0.00 3:2.60 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:1.00 14:0.00 15:0.00 16:0.00 17:0.00 18:0.00 19:0.00 20:0.0
1 0:4.41 1:0.31 2:0.01 3:2.21 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:1.01 14:0.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
1 0:4.41 1:0.31 2:0.01 3:1.91 4:0.01 5:0.01 6:0.01 7:0.01 8:0.01 9:0.01 10:0.01 11:0.01 12:0.01 13:0.01 14:1.01 15:0.01 16:0.01 17:0.01 18:0.01 19:0.01 20:0.0
0 0:4.40 1:0.30 2:0.00 3:1.80 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:1.00 14:0.00 15:0.00 16:0.00 17:0.00 18:0.00 19:0.00 20:0.0
0 0:4.40 1:0.30 2:0.00 3:1.60 4:0.00 5:0.00 6:0.00 7:0.00 8:0.00 9:0.00 10:0.00 11:0.00 12:0.00 13:1.00 14:0.00 15:0.00 16:0.00 17:0.00 18:0.00 19:0.00 20:0.0
输出不会从初始点移动,但是我不确定为什么:
[0] train-map@1:0.000055 test-map@1:0.000055
[1] train-map@1:0.000055 test-map@1:0.000055
[2] train-map@1:0.000055 test-map@1:0.000055
[3] train-map@1:0.000055 test-map@1:0.000055
[4] train-map@1:0.000055 test-map@1:0.000055
[5] train-map@1:0.000055 test-map@1:0.000055
[6] train-map@1:0.000055 test-map@1:0.000055
[7] train-map@1:0.000055 test-map@1:0.000055
[8] train-map@1:0.000055 test-map@1:0.000055
[9] train-map@1:0.000055 test-map@1:0.000055
[10] train-map@1:0.000055 test-map@1:0.000055
[11] train-map@1:0.000055 test-map@1:0.000055
[12] train-map@1:0.000055 test-map@1:0.000055
[13] train-map@1:0.000055 test-map@1:0.000055
[14] train-map@1:0.000055 test-map@1:0.000055
[15] train-map@1:0.000055 test-map@1:0.000055
[16] train-map@1:0.000055 test-map@1:0.000055
[17] train-map@1:0.000055 test-map@1:0.000055
[18] train-map@1:0.000055 test-map@1:0.000055
[19] train-map@1:0.000055 test-map@1:0.000055
[20] train-map@1:0.000055 test-map@1:0.000055
[21] train-map@1:0.000055 test-map@1:0.000055
[22] train-map@1:0.000055 test-map@1:0.000055
[23] train-map@1:0.000055 test-map@1:0.000055
[24] train-map@1:0.000055 test-map@1:0.000055
[25] train-map@1:0.000055 test-map@1:0.000055
[26] train-map@1:0.000055 test-map@1:0.000055
[27] train-map@1:0.000055 test-map@1:0.000055
[28] train-map@1:0.000055 test-map@1:0.000055
[29] train-map@1:0.000055 test-map@1:0.000055
[30] train-map@1:0.000055 test-map@1:0.000055
[31] train-map@1:0.000055 test-map@1:0.000055
[32] train-map@1:0.000055 test-map@1:0.000055
[33] train-map@1:0.000055 test-map@1:0.000055
[34] train-map@1:0.000055 test-map@1:0.000055