0
$\begingroup$

I have developed a train set for XGBoost to apply a learning to rank function on top of with the following parameters:

eta = 0.5
estimators = 150
max_depth = 5
objective = rank:pairwise
gamma = 1.0
eval = ndcg

And applied in this function to train:

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)
    }

And an example of a data grouping is:

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

The output does not move from the initial point, but I am not sure why:

[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
$\endgroup$
  • $\begingroup$ Without code we can't help you $\endgroup$ – fuwiak May 29 '19 at 21:30
  • $\begingroup$ Thanks for the comment, the function is very short and is added. $\endgroup$ – Jacob B May 29 '19 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.