You can implement your own custom ItemSimilarity that computes this metric, or anything else you can imagine. In fact there is already a bit of API in DataModel for storing and retrieving timestamps too, so this should be easy.
It's probably a bit easier said than done given the exact logic you're implementing, but, that's how you'd approach it. Sean On Mon, Mar 12, 2012 at 1:28 PM, Mridul Kapoor <mridulkap...@gmail.com> wrote: > I have been ramping up on Mahout recently. Found the book Mahout in Action > really very helpful in this regard. > > I have been planning to write a custom recommender (item-based). Would > really appreciate help in this regard. What I actually have is something > like this > > In the system, there is no inherent explicit rating or preference system -- >> either the user would have consumed a content, or would not have consumed >> it. But then, I specifically want to consider 2 items most similar when >> they are consumed/viewed within 1(one) hour of each other most number of >> times. > > > > Say, for Item X : > > > > User U1 consumes(views) it at time T1 -- and in T1 +(-) 1 hour --- U1 also >> consumes Items a, b, c and d. > > > > User U2 consumes(views) it at time T2 -- and in T2 +(-) 1 hour --- U2 also >> consumes Items a, c and e. > > > > User U3 consumes(views) it at time T3 -- and in T3 +(-) 1 hour --- U3 also >> consumes Items a and b. >> > >> So we would go on to say that Item X is co-occurring mostly with Item a >> (at 3 instances), followed by Item b,c (each at 2 instances) and so on... > > > > This is pretty much how I would like to compute the similarities . > > > > > Going through the book Mahout in Action and other online resources, I > wasn't able to find an implementation close enough to this. Would > appreciate help on how to go further on this -- some pointers to how should > I go on about it > > Thanks > Mridul