@@ -0,0 +1,2057 @@
+package edu.ntnu.idi.goldfish;%0A%0Aimport edu.ntnu.idi.goldfish.configurations.Config;%0Aimport edu.ntnu.idi.goldfish.configurations.Lynx;%0Aimport edu.ntnu.idi.goldfish.mahout.DBModel;%0Aimport edu.ntnu.idi.goldfish.preprocessors.Preprocessor;%0Aimport edu.ntnu.idi.goldfish.preprocessors.PreprocessorStat;%0Aimport org.apache.mahout.cf.taste.model.DataModel;%0Aimport org.apache.mahout.cf.taste.recommender.Recommender;%0A%0Apublic class Timing %7B%0A%0A    public int i = 1;%0A%0A    public static DataSet set;%0A%0A%09// disable Mahout logging output%0A%09static %7B%0A%09%09 System.setProperty(%22org.apache.commons.logging.Log%22,%0A%09%09 %22org.apache.commons.logging.impl.NoOpLog%22);%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A        new Timing(args);%0A    %7D%0A%0A    public Timing(String%5B%5D args) throws Exception %7B%0A        // start timing of rebuild%0A        StopWatch.start(%22totalRebuild%22);%0A%0A        // load dataset from database into DataModel%0A        StopWatch.start(%22getModel%22);%0A%0A        DBModel.startServer();%0A        DataModel model = DataSet.MovielensMock1M.getModel();%0A%0A//%0A        System.out.format(%22%25s (%25d users, %25d items)%5Cn%22, StopWatch.str(%22getModel%22), model.getNumUsers(), model.getNumItems());%0A%0A        // set configuration parameters and preprocessor%0A        Config config = new Lynx()%0A                .set(%22model%22, model)%0A                .set(%22minTimeOnPage%22, 25000)%0A                .set(%22correlationLimit%22, 0.3)%0A                .set(%22rating%22, 4)%0A                .set(%22predictionMethod%22, PreprocessorStat.PredictionMethod.ClosestNeighbor);%0A%0A        // preprocess dataModel%0A        StopWatch.start(%22preprocess%22);%0A        Preprocessor preprocessor = new PreprocessorStat();%0A        model = preprocessor.preprocess(config);%0A        System.out.format(%22%25s (%25d users, %25d items)%5Cn%22, StopWatch.str(%22preprocess%22), model.getNumUsers(), model.getNumItems());%0A%0A        // build Recommendation model%0A        StopWatch.start(%22buildRecommender%22);%0A        Recommender newRecommender = ((Lynx) config).getBuilder().buildRecommender(model);%0A        StopWatch.print(%22buildRecommender%22);%0A%0A%0A    %7D%0A%7D%0A

Add timing class to evaluate the preprocessor performance on a large synthesized dataset