mahout-user mailing list archives

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

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",
"rating");
            LongPrimitiveIterator iterator =
mySQLJDBCDataModel.getUserIDs();
            UserSimilarity userSimilarity = new
PearsonCorrelationSimilarity(mySQLJDBCDataModel);
            // 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,
userSimilarity);
            //List<RecommendedItem> recommendations =
recommender.recommend(getLongFromUUId(userId),NRecommandations );
            List<RecommendedItem> recommendations =
recommender.recommend(1,2);


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

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