This is a characteristic of the recommender that I have complained about 
before. At one point I tracked down the code that actually removed all 
preferred items from the recommendations. You will have to find that bit of 
code and remove it. That means you’ll have to fork Mahout and build it. While 
easy to do, it means you’ll have to merge your fix with new Mahout code every 
so often.

I would encourage you to log this on the Mahout Jira as a bug. There should be 
an option to allow preferred items in recommendations. There are many cases 
where you do not want to filter these out, such as recommending frequently 
bought consumables. You may want to apply other business rules to the 
filtering, perhaps based on consumption frequency. 

In any case, the last time I looked it was a fairly simple fix. If you can’t 
find it I’ll see if I can.

  
On Mar 2, 2014, at 4:15 AM, Juan José Ramos <[email protected]> wrote:

I am using a GenericItemBasedRecommender and have faced the same problem.

In my case the items are news and the user does not provide an explicit
rating but the system would infer one for him/her based on the actions he
makes: Reading, sharing, favouriting...

The approach I have followed has been that on one hand, I get the list of
recommended items the recommender provides and on the other hand, from the
DataModel, I get those items with highest ratings.

I blend the two lists but the obvious problem is that the rating for the
recommended items will never exceed the highest rating of the already
consumed items. What I have done in that case is to apply a penalizing
factor to the items the user has already consumed when blending the two
lists. I'm not quite happy with that approach. Maybe somebody can provide a
better one.


On Sat, Mar 1, 2014 at 9:32 PM, Mario Levitin <[email protected]>wrote:

> Hi,
> Mahout do not recommend items which are already consumed by the user.
> 
> For example,
> In the getAllOtherItems method of GenericUserBasedRecommender class there
> is the following line
> 
> possibleItemIDs.removeAll(dataModel.getItemIDsFromUser(theUserID));
> 
> which removes user's items from the possibleItemIDs to prevent these items
> from being recommended to the user. This is ok for many recommendation
> cases but in my case it is not.
> 
> What is the best way to change this behavior, for example I might create a
> new class which extends GenericUserBasedRecommender and overwrite the
> getAllOtherItems and remove line
> 
> possibleItemIDs.removeAll(dataModel.getItemIDsFromUser(theUserID));
> 
> 
> Thanks.
> 

Reply via email to