Package org.apache.hama.ml.recommendation.cf

Examples of org.apache.hama.ml.recommendation.cf.OnlineCF.load()


      recommender.setTaskCount(2);
      recommender.setUpdateFunction(MeanAbsError.class);
      recommender.setOutputPath(outputFileName);
      assertEquals(true, recommender.train());

      recommender.load(outputFileName, false);
      int correct = 0;
      for (Preference<Integer, Integer> test : test_prefs) {
        double actual = test.getValue().get();
        double estimated = recommender.estimatePreference(test.getUserId(), test.getItemId());
        correct += (Math.abs(actual-estimated)<0.5)?1:0;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.