For the JDBCDataModel implementations, there is no concept of reloading. The database is always queried for the latest data; it's always up-to-date.
The UserSimilarity implementations likewise always compute from current data in the DataModel. You're not using a CachingUserSimilarity wrapper, so it will not be using old cached values. So I guess the answer is you don't have to do anything here. On Wed, Oct 6, 2010 at 9:34 AM, Amel Fraisse <[email protected]> wrote: > 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 >
