public static void predictRandomResources(String filename, int trainSize) { // filename += "_res"; // TODO: do not use complete size BookmarkReader reader = new BookmarkReader(0, false); reader.readFile(filename); List<int[]> values = getRandomResources(reader, 10, trainSize); PredictionFileWriter writer = new PredictionFileWriter(reader, values); writer.writeResourcePredictionsToFile(filename + "_rand", trainSize, 0); }
public static void predictPopularTags(String filename, int trainSize, int sampleSize) { // filename += "_res"; BookmarkReader reader = new BookmarkReader(trainSize, false); reader.readFile(filename); List<int[]> values = getPopularTags(reader, sampleSize, 10); // List<int[]> values = getPerfectTags(reader, sampleSize, 10); reader.setUserLines(reader.getUserLines().subList(trainSize, reader.getUserLines().size())); PredictionFileWriter writer = new PredictionFileWriter(reader, values); writer.writeFile(filename + "_mp"); Utilities.writeStringToFile("./data/metrics/" + filename + "_mp" + "_TIME.txt", timeString); }