1

I want to do 5 fold cross validation on MQ2008 dataset. I am using RankLib to apply ML algo on the dataset. I am confused about the kcv option given in Ranklib for cross validation. command used:

java - jar RankLib.jar -ranker 0 -train train.txt -test test.txt -validate vali.txt -kcv 5

here we are specifying different files for training,testing and validation.Then how it is dividing data for 5 fold cross validation.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Neha
  • 19
  • 2
  • 6

1 Answers1

0

To do k-fold cross-validation using ranklib, you only need to use one dataset.

The program itself divides the data to train, test and validate randomly. When you use 5-fold cross-validation, the program will repeat the process 5 times and it gives you the average of the 5 analyses as the final result. You need to choose a metric for your learning evaluation. See [ -metric2t <metric> ] on this How to use page.

For example, see the command below. I have only one dataset to feed my algorithm. I used NDCG@10 as my evaluation metric. Also, I used -kcvmd to save my models in a directory and -kcvmn to name the models.

java -jar RankLib-2.1-patched.jar -train trainingData.txt -ranker 8 -kcv 5 -kcvmd kcvModels/ -kcvmn txt -metric2t NDCG@10 -metric2T NDCG@10 -save Models/model.txt
Soroosh Sorkhani
  • 66
  • 1
  • 3
  • 15