You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Dimitar Roustchev <d....@googlemail.com> on 2011/11/23 16:38:03 UTC

"Context-aware" recommendations redux

Hi everyone,

I'm fairly new to Mahout and actually only use a small subset of it yet,
namely Taste. I've already searched the mailing list archives about
"context-aware recommendations" and found one thread which is a year old,
hence this is a redux of sort.

I'm having a hard time figuring out how to best incorporate contextual
information into Mahout/Taste recommenders. For the project I'm currently
working on, I use the fairly new MongoDBDataModel. The items I want to
recommend have a location associated to them in form or latitude and
longitude values. The MongoDBDataModel basically maps my collection to a
GenericDataModel with GenericPreferences. So I have no additional
information in the preferences anymore and would have to first look up the
ID used by the MongoDB collection from the long ID used by Mahout. and once
I have the ID, I would have to look up the item from the original MongoDB
collection.
In the existing thread on context-aware recommenders, Sean Owen suggested
to use IDRescorer. I'm not sure I understand the functionality of the
Rescorer completely, or at least how to best make use of it. As far as I
understand, it only modifies the preference value of an item. And further,
it does this while estimating the preference value of an item the user has
not already rated. So if I want to exclude items that are outside of a
certain radius of the user's current position, I would have to somehow get
the information for each item and hence would have many many request to the
database.

Could one also use CandidateItemsStrategy in order to filter out items that
are to be excluded based on contextual information prior to estimating
preferences? This way, I could make use of geo-spatial queries MongoDB
supports and get the IDs of the items that are in a certain range and
translate them the Mahout internal IDs and only use these items for
collaborative filtering.
While writing this up, a downside pops up though. If I use the
CandidateItemsStrategy, the items excluded, would also not be used for
calculating similar users, right?

I would really appreciate some input on this, any thoughts, ideas, concerns
are highly welcome.

Thanks,

Dimi

Re: "Context-aware" recommendations redux

Posted by Dimitar Roustchev <d....@googlemail.com>.
Thanks for the quick response Sean!

Since the location of the user is only one aspect I'm trying to use, I
think I will have to pre-filter items based on location using the
CandidateItemsStrategy and post-filter items further using an IDRescorer.
Thanks for clarifying which hook to use best. I'll probably report back
once I have results or more questions.

Dimi

On Wed, Nov 23, 2011 at 5:03 PM, Sean Owen <sr...@gmail.com> wrote:

> Yes, IDRescorer comes "too late" in the pipeline to do what you want.
> CandidateItemsStrategy
> is the more likely hook to use. This lets you pick what items will be used
> in figuring out how good a recommendation is for a particular item. Maybe
> you want to only consider similarity with items within a certain distance.
> You are not picking which items or users will be used in the similarity
> calculation. You are picking which items or users you compute a similarity
> with in the first place.
>
> On Wed, Nov 23, 2011 at 3:38 PM, Dimitar Roustchev <
> d.roustchev@googlemail.com> wrote:
>
> > Hi everyone,
> >
> > I'm fairly new to Mahout and actually only use a small subset of it yet,
> > namely Taste. I've already searched the mailing list archives about
> > "context-aware recommendations" and found one thread which is a year old,
> > hence this is a redux of sort.
> >
> > I'm having a hard time figuring out how to best incorporate contextual
> > information into Mahout/Taste recommenders. For the project I'm currently
> > working on, I use the fairly new MongoDBDataModel. The items I want to
> > recommend have a location associated to them in form or latitude and
> > longitude values. The MongoDBDataModel basically maps my collection to a
> > GenericDataModel with GenericPreferences. So I have no additional
> > information in the preferences anymore and would have to first look up
> the
> > ID used by the MongoDB collection from the long ID used by Mahout. and
> once
> > I have the ID, I would have to look up the item from the original MongoDB
> > collection.
> > In the existing thread on context-aware recommenders, Sean Owen suggested
> > to use IDRescorer. I'm not sure I understand the functionality of the
> > Rescorer completely, or at least how to best make use of it. As far as I
> > understand, it only modifies the preference value of an item. And
> further,
> > it does this while estimating the preference value of an item the user
> has
> > not already rated. So if I want to exclude items that are outside of a
> > certain radius of the user's current position, I would have to somehow
> get
> > the information for each item and hence would have many many request to
> the
> > database.
> >
> > Could one also use CandidateItemsStrategy in order to filter out items
> that
> > are to be excluded based on contextual information prior to estimating
> > preferences? This way, I could make use of geo-spatial queries MongoDB
> > supports and get the IDs of the items that are in a certain range and
> > translate them the Mahout internal IDs and only use these items for
> > collaborative filtering.
> > While writing this up, a downside pops up though. If I use the
> > CandidateItemsStrategy, the items excluded, would also not be used for
> > calculating similar users, right?
> >
> > I would really appreciate some input on this, any thoughts, ideas,
> concerns
> > are highly welcome.
> >
> > Thanks,
> >
> > Dimi
> >
>

Re: "Context-aware" recommendations redux

Posted by Sean Owen <sr...@gmail.com>.
Yes, IDRescorer comes "too late" in the pipeline to do what you want.
CandidateItemsStrategy
is the more likely hook to use. This lets you pick what items will be used
in figuring out how good a recommendation is for a particular item. Maybe
you want to only consider similarity with items within a certain distance.
You are not picking which items or users will be used in the similarity
calculation. You are picking which items or users you compute a similarity
with in the first place.

On Wed, Nov 23, 2011 at 3:38 PM, Dimitar Roustchev <
d.roustchev@googlemail.com> wrote:

> Hi everyone,
>
> I'm fairly new to Mahout and actually only use a small subset of it yet,
> namely Taste. I've already searched the mailing list archives about
> "context-aware recommendations" and found one thread which is a year old,
> hence this is a redux of sort.
>
> I'm having a hard time figuring out how to best incorporate contextual
> information into Mahout/Taste recommenders. For the project I'm currently
> working on, I use the fairly new MongoDBDataModel. The items I want to
> recommend have a location associated to them in form or latitude and
> longitude values. The MongoDBDataModel basically maps my collection to a
> GenericDataModel with GenericPreferences. So I have no additional
> information in the preferences anymore and would have to first look up the
> ID used by the MongoDB collection from the long ID used by Mahout. and once
> I have the ID, I would have to look up the item from the original MongoDB
> collection.
> In the existing thread on context-aware recommenders, Sean Owen suggested
> to use IDRescorer. I'm not sure I understand the functionality of the
> Rescorer completely, or at least how to best make use of it. As far as I
> understand, it only modifies the preference value of an item. And further,
> it does this while estimating the preference value of an item the user has
> not already rated. So if I want to exclude items that are outside of a
> certain radius of the user's current position, I would have to somehow get
> the information for each item and hence would have many many request to the
> database.
>
> Could one also use CandidateItemsStrategy in order to filter out items that
> are to be excluded based on contextual information prior to estimating
> preferences? This way, I could make use of geo-spatial queries MongoDB
> supports and get the IDs of the items that are in a certain range and
> translate them the Mahout internal IDs and only use these items for
> collaborative filtering.
> While writing this up, a downside pops up though. If I use the
> CandidateItemsStrategy, the items excluded, would also not be used for
> calculating similar users, right?
>
> I would really appreciate some input on this, any thoughts, ideas, concerns
> are highly welcome.
>
> Thanks,
>
> Dimi
>