mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From IƱigo Llamosas <inigollamo...@gmail.com>
Subject creating projects in eclipse
Date Tue, 15 Jan 2013 11:49:04 GMT
Hi everybody,

I am trying to create mahout projects in Eclipse from scratch. I am
creating them as Java projects and then adding the required libraries in
the build path as required.
Now I want to run the following code in the main class:

  public static void main(String[] args) throws Exception {

    DataModel model = new FileDataModel(new
File("/usr/local/mahout-book-master/src/main/java/mia/recommender/ch04/sample.dat"));
    UserSimilarity similarity = new EuclideanDistanceSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(100,
similarity, model);
    Recommender recommender = new GenericUserBasedRecommender(model,
neighborhood, similarity);
    List<RecommendedItem> recommendations = recommender.recommend(1, 5);
System.out.println(recommendations);
System.exit(0);
...

If I run this on my own project, there's no output ([]). But if I create an
extra class inside mia.recommender.ch04, for example, it works fine. That
is, for example:

[RecommendedItem[item:590, value:5.0], RecommendedItem[item:110,
value:5.0], RecommendedItem[item:151, value:3.0]]

This obviously brings me to the conclussion that I am missing something on
my project. But data is loaded, libraries are imported...

1. What could it be, and if so, could it be fixed being a Java project, or
do I need to switch it to Maven project?
2. Generally speaking, is it possible to create mahout projects as Java
projects or I will sooner or later have to create them as Maven projects?

Thank you very much

Inigo

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message