0

So, I'm building an algorithm and i need to perform only the crossfold task, and not the entire evaluator. This is my code:

File file = new File("lenskitreadyDatabase.csv");
EventFormat eventFormat = new CustomFormatter();
DataSource dataSource = new GenericDataSource("split", new TextEventDAO(file, eventFormat));

CrossfoldTask task = new CrossfoldTask("cross10");

task
    .setHoldout(5)
    .setSource(dataSource)
    .setPartitions(FIRST_CROSSFOLD)
    .setProject(new EvalProject(new Properties()));

List<TTDataSet> l = task.perform();

l.stream().forEach(v -> {
        System.out.println(v.getName());
        System.out.println(v.getTestData().getEventDAO().streamEvents().hasNext());
    });

Lenskit is creating all my train-test files, but they are all empty. I've used the forEach method to check if the error was on writing the files to disk, but apparently it isn't, because this is the logs that i'm getting with those System.out.printLn():

cross10.0
false
cross10.1
false
cross10.2
false
cross10.3
false
cross10.4
false
cross10.5
false
cross10.6
false
cross10.7
false
cross10.8
false
cross10.9
false

I haven't found much information about running only the crossfold task and not the entire evaluator, so if you could shed a light on, it would be amazing. thanks

Igor Santana
  • 143
  • 1
  • 12
  • Try deleting the output files and running again, or turning on the `CrossfoldTask`'s `force` option (if it is in the version of LensKit you are using). – Michael Ekstrand Sep 12 '16 at 03:00
  • i'm using the version 2.2.1! Done that and still got nothing :/ – Igor Santana Sep 12 '16 at 11:54
  • Does the logging output, if you enable `DEBUG` logging in your SLF4J backend, say anything useful? The crossfolder is pretty chatty about what it is doing. – Michael Ekstrand Sep 12 '16 at 14:27
  • The only thing it says is the following: `0 [main] INFO org.grouplens.lenskit.eval.data.crossfold.CrossfoldTask - splitting data source cross10 to 10 partitions by users 915 [main] INFO org.grouplens.lenskit.eval.data.crossfold.CrossfoldTask - Splititng 9740 users into 10 partitions` – Igor Santana Sep 12 '16 at 15:24
  • i tested the crossfoldtask with the ml-100k data and it worked. now i have to discover a way to format my .csv file into a datasource – Igor Santana Sep 12 '16 at 15:50

0 Answers0