How to speed up the item-based Recommenders system?

I read about 7 million rows of data, and it takes about two minutes to reboot the application to load everything. I'm trying to find the best way to speed things up, it took just a few seconds to restart the application. Here is the code I want to speed up, and the amount of time it is taking now:

// Creating data model - this takes about 1.77 minutes
DataModel datamodel = new FileDataModel(new File("datafile"));

// ItemSimilarity object - this takes about 1 millisecond
ItemSimilarity similarity = new TanimotoCoefficientSimilarity(datamodel);

// Recommender - this takes about 3 milliseconds
ItemBasedRecommender irecommender = new GenericBooleanPrefItemBasedRecommender(datamodel, similarity);

// List of Recommendations - this takes about 365 milliseconds
List<RecommendedItem> irecommendations = irecommender.mostSimilarItems(item, amount);

I am wondering if:

  • Is there a way to output DataModelto another file so that I can just read it and not create it every time?
  • If possible, is it possible to output data from ItemSimilarityto another file and just read that instead of creating DataModeland calculating ItemSimilarityeach time?
+4
source share
1

DataModel , , ?

, . (. http://www.ibm.com/developerworks/library/j-5things1/). , , , .

- , . , , . , , ( ). , .

db , ​​ HSQLDB, db db - - . , db - , , db, .

, ItemSimilarity , DataModel ItemSimilarity ?

. . , , , .

, . , . , , db, .

, .

+2

All Articles