On 05/17/2012 02:06 PM, Sean Owen wrote:
I think it will be way too slow to update a file like this, as you must
seek and rewrite the whole thing. Files aren't for this sort of update. A
DB might be.
Even if it were it is probably too slow to read the similarity from backing
store each time. It needs to be mostly in memory. That's why the caching
wrapper is probably what you want.
Sean
On May 17, 2012 11:25 AM, "Nikolaos Romanos Katsipoulakis"<
[email protected]> wrote:
Hey guys,
In my recommender i need to save my UserSimilarity (CachingUserSimilarity
to be exact) in a file, and whenever I get a request for a recommendation,
i need to load it from a file, retrieve the recommendation, and then store
it back in a file. Can this be done? I have seen in the mahout
documentation a class FileItemSimilarity, which has a constructor that
parses the FileItemSimilarity from a file. Is there a similar
FileUserSimilarity? How is the FileItemSimilarity represented in the file?
Thank you
Thank you for your immediate answer. Hmm, I think you are right. The
problem is that I want to maintain a static Recommender Object in a web
service (and use it as a singleton for all invocations of the web
service), that is updated asynchronously, and is persistent among all
threads. Do you think that this is a more acceptable design in matter of
performance?
Thank you