mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amel Fraisse <>
Subject DataModel and recommendation
Date Wed, 06 Oct 2010 08:34:33 GMT

I a working with DataModel to compute user similarity and recommend Item.

This is my code:

           MySQLJDBCDataModel mySQLJDBCDataModel = new
MySQLJDBCDataModel(dataSource, "data_model_rating", "user_id", "item_id",
            LongPrimitiveIterator iterator =
            UserSimilarity userSimilarity = new
            // compute The k-Nearst Neighborhood of the current user
            UserNeighborhood neighborhood = new NearestNUserNeighborhood(2,
userSimilarity, mySQLJDBCDataModel);

            long [] neighborhoodId = neighborhood.getUserNeighborhood(1);

            //Get the top N recommendations
            Recommender recommender = new
GenericUserBasedRecommender(mySQLJDBCDataModel, neighborhood,
            //List<RecommendedItem> recommendations =
recommender.recommend(getLongFromUUId(userId),NRecommandations );
            List<RecommendedItem> recommendations =

I don't Know How I could use the DataModel to build only new data. For
example if the DataModel contains 10 rating and after 2 hours I have 2 new
rating. So I suppose that I don't have to reload all the DataModel and
Recompute all similarities ?

How Mahout manage the Delta DataModel.

Thank you for your help.

Amel Fraisse

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