Package org.apache.mahout.cf.taste.impl.eval

Examples of org.apache.mahout.cf.taste.impl.eval.AverageAbsoluteDifferenceRecommenderEvaluator.evaluate()


          throw new TasteException(ioe);
        }

      }
    };
    double score = evaluator.evaluate(recommenderBuilder, null, model, 0.95, 0.1);
    System.out.println(score);
  }

}
View Full Code Here


        UserNeighborhood neighborhood =
          new NearestNUserNeighborhood(100, similarity, model);
        return new GenericUserBasedRecommender(model, neighborhood, similarity);
      }
    };
    double score = evaluator.evaluate(recommenderBuilder, null, model, 0.95, 0.05);
    System.out.println(score);
  }

}
View Full Code Here

      public DataModel buildDataModel(FastByIDMap<PreferenceArray> trainingData) {
        return new GenericBooleanPrefDataModel(
          GenericBooleanPrefDataModel.toDataMap(trainingData));
      }
    };
    double score = evaluator.evaluate(
        recommenderBuilder, modelBuilder, model, 0.9, 1.0);
    System.out.println(score);
  }

}
View Full Code Here

          new NearestNUserNeighborhood(2, similarity, model);
        return new GenericUserBasedRecommender(model, neighborhood, similarity);
      }
    };
    // Use 70% of the data to train; test using the other 30%.
    double score = evaluator.evaluate(recommenderBuilder, null, model, 0.7, 1.0);
    System.out.println(score);
  }
}
View Full Code Here

    if (ratingsFile != null) {
      model = new JesterDataModel(ratingsFile);
    } else {
      model = new JesterDataModel();
    }
    double evaluation = evaluator.evaluate(new JesterRecommenderBuilder(),
      null,
      model,
      0.9,
      0.3);
    log.info(String.valueOf(evaluation));
View Full Code Here

    if (ratingsFile != null) {
      model = new GroupLensDataModel(ratingsFile);
    } else {
      model = new GroupLensDataModel();
    }
    double evaluation = evaluator.evaluate(new GroupLensRecommenderBuilder(),
      null,
      model,
      0.9,
      0.3);
    log.info(String.valueOf(evaluation));
View Full Code Here

      model = new BookCrossingDataModel(ratingsFile, false);
    } else {
      model = new BookCrossingDataModel(false);
    }
   
    double evaluation = evaluator.evaluate(new BookCrossingRecommenderBuilder(),
      null,
      model,
      0.9,
      0.3);
    log.info(String.valueOf(evaluation));
View Full Code Here

  public static void main(String... args) throws IOException, TasteException, OptionException {
    RecommenderEvaluator evaluator = new AverageAbsoluteDifferenceRecommenderEvaluator();
    File ratingsFile = TasteOptionParser.getRatings(args);
    if (ratingsFile != null) {
      DataModel model = new NetflixDataModel(ratingsFile, true);
      double evaluation = evaluator.evaluate(new NetflixRecommenderBuilder(), null, model, 0.9, 0.1);
      log.info(String.valueOf(evaluation));
    } else {
      log.error("Netflix Recommender needs a ratings file to work. Please provide it with the -i command line option.");
    }
  }
View Full Code Here

  }

  public static void main(String... args) throws IOException, TasteException {
    RecommenderEvaluator evaluator = new AverageAbsoluteDifferenceRecommenderEvaluator();
    BookCrossingDataModel model = new BookCrossingDataModel();
    double evaluation = evaluator.evaluate(new BookCrossingRecommenderBuilder(model),
                                                 model,
                                                 0.9,
                                                 0.1);
    log.info(String.valueOf(evaluation));
  }
View Full Code Here

  }

  public static void main(String... args) throws IOException, TasteException {
    RecommenderEvaluator evaluator = new AverageAbsoluteDifferenceRecommenderEvaluator();
    DataModel model = new JesterDataModel();
    double evaluation = evaluator.evaluate(new JesterRecommenderBuilder(),
                                                 model,
                                                 0.9,
                                                 1.0);
    log.info(String.valueOf(evaluation));
  }
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.