@@ -332,7 +332,7 @@ public static BookmarkReader predictSample(String filename, int trainSize, int s
332332 return reader ;
333333 }
334334
335- public static void createSample (String filename , short numTopics , boolean tagRec , Integer creationTrainSize ) {
335+ public static void createSample (String filename , short numTopics , boolean tagRec , int trainSize , boolean personalizedTopicCreation ) {
336336 Timer timerThread = new Timer ();
337337 MemoryThread memoryThread = new MemoryThread ();
338338 timerThread .schedule (memoryThread , 0 , MemoryThread .TIME_SPAN );
@@ -344,7 +344,8 @@ public static void createSample(String filename, short numTopics, boolean tagRec
344344 } else {
345345 TOPIC_THRESHOLD = 0.01 ;
346346 }
347-
347+ Integer creationTrainSize = (personalizedTopicCreation ? trainSize : null );
348+
348349 BookmarkReader reader = new BookmarkReader (creationTrainSize == null ? 0 : creationTrainSize .intValue (), false );
349350 reader .readFile (filename );
350351 int size = reader .getBookmarks ().size ();
@@ -360,14 +361,14 @@ public static void createSample(String filename, short numTopics, boolean tagRec
360361 }
361362 List <Bookmark > userSample = reader .getBookmarks ().subList (0 , size );
362363 BookmarkSplitter .writeSample (reader , userSample , outputFile , predictionValues );
363- if (creationTrainSize != null ) {
364- List <Bookmark > trainUserSample = reader .getBookmarks ().subList (0 , creationTrainSize . intValue () );
365- List <int []> trainPredictionValues = predictionValues .subList (0 , creationTrainSize . intValue () );
366- List <Bookmark > testUserSample = reader .getBookmarks ().subList (creationTrainSize . intValue () , size );
367- List <int []> testPredictionValues = predictionValues .subList (creationTrainSize . intValue () , size );
364+ // if (creationTrainSize != null) {
365+ List <Bookmark > trainUserSample = reader .getBookmarks ().subList (0 , trainSize );
366+ List <int []> trainPredictionValues = predictionValues .subList (0 , trainSize );
367+ List <Bookmark > testUserSample = reader .getBookmarks ().subList (trainSize , size );
368+ List <int []> testPredictionValues = predictionValues .subList (trainSize , size );
368369 BookmarkSplitter .writeSample (reader , trainUserSample , outputFile + "_train" , trainPredictionValues );
369370 BookmarkSplitter .writeSample (reader , testUserSample , outputFile + "_test" , testPredictionValues );
370- }
371+ // }
371372
372373 timeString = PerformanceMeasurement .addMemoryMeasurement (timeString , false , memoryThread .getMaxMemory ());
373374 timerThread .cancel ();
0 commit comments