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

Examples of org.apache.mahout.cf.taste.impl.similarity.EuclideanDistanceSimilarity


    this(new FileDataModel(readResourceToTempFile("ratings.dat")));
  }

  public LibimsetiRecommender(DataModel model)
      throws TasteException, IOException {
    UserSimilarity similarity = new EuclideanDistanceSimilarity(model);
    UserNeighborhood neighborhood =
        new NearestNUserNeighborhood(2, similarity, model);
    delegate =
        new GenericUserBasedRecommender(model, neighborhood, similarity);
    this.model = model;
View Full Code Here


public final class BookCrossingRecommender implements Recommender {

  private final Recommender recommender;

  public BookCrossingRecommender(DataModel bcModel) throws TasteException {
    UserSimilarity similarity = new CachingUserSimilarity(new EuclideanDistanceSimilarity(bcModel), bcModel);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, 0.2, similarity, bcModel, 0.2);
    recommender = new GenericUserBasedRecommender(bcModel, neighborhood, similarity);
  }
View Full Code Here

    if (args.length > 1) {
      howMany = Integer.parseInt(args[1]);
    }

    System.out.println("Run Items");
    ItemSimilarity similarity = new EuclideanDistanceSimilarity(model);
    Recommender recommender = new GenericItemBasedRecommender(model, similarity); // Use an item-item recommender
    for (int i = 0; i < LOOPS; i++){
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
    }

    System.out.println("Run Users");
    UserSimilarity userSim = new EuclideanDistanceSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, userSim, model);
    recommender = new GenericUserBasedRecommender(model, neighborhood, userSim);
    for (int i = 0; i < LOOPS; i++){
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
View Full Code Here

public final class BookCrossingRecommender implements Recommender {

  private final Recommender recommender;

  public BookCrossingRecommender(DataModel bcModel) throws TasteException {
    UserSimilarity similarity = new CachingUserSimilarity(new EuclideanDistanceSimilarity(bcModel), bcModel);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, 0.2, similarity, bcModel, 0.2);
    recommender = new GenericUserBasedRecommender(bcModel, neighborhood, similarity);
  }
View Full Code Here

    if (args.length > 1) {
      howMany = Integer.parseInt(args[1]);
    }

    System.out.println("Run Items");
    ItemSimilarity similarity = new EuclideanDistanceSimilarity(model);
    Recommender recommender = new GenericItemBasedRecommender(model, similarity); // Use an item-item recommender
    for (int i = 0; i < LOOPS; i++) {
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
    }

    System.out.println("Run Users");
    UserSimilarity userSim = new EuclideanDistanceSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, userSim, model);
    recommender = new GenericUserBasedRecommender(model, neighborhood, userSim);
    for (int i = 0; i < LOOPS; i++) {
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.similarity.EuclideanDistanceSimilarity

Copyright © 2018 www.massapicom. 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.