You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Cam Bazz <ca...@gmail.com> on 2008/05/26 13:58:27 UTC
help for item based recommender
Hello,
I am going over the documentation and meant to do a item based recomender.
I understand that the datamodel is fed with triplets in form of:
userid, itemid, likingscore
There is a part in the code which says:
// Construct the list of pre-compted correlations
Collection<GenericItemCorrelation.ItemItemCorrelation> correlations =
...;
ItemCorrelation itemCorrelation = new GenericItemCorrelation(correlations);
and the explanation mentions we have to feed a list of pre-computed
corelations to the GenericItemCorelation.
How do we pre-compute corelations?
Best.
-C.B.
Re: help for item based recommender
Posted by Sean Owen <sr...@gmail.com>.
This sounds like a different question. You have preference data and
you want to provide it to a Recommender? you need to use a DataModel
implementation for this, and FileDataModel should read the file as you
have it. Just pass it to the FileDataModel, and FileDataModel to your
Recommender.
If you have some file of *item-item correlations* that you want to
feed to GenericItemCorrelation, then simply read them one by one,
create ItemItemCorrelation objects in a List, and feed that to the
GenericItemCorrelation constructor.
If you want to use PearsonCorrelation to automatically figure the
correlations between items, then feed FileDataModel to
PearsonCorrelation and use PearsonCorrelation in the constructor to
GenericItemBasedRecommender.
On Tue, May 27, 2008 at 4:36 AM, Cam Bazz <ca...@gmail.com> wrote:
> Hello Sean,
>
> Thanks a lot for the detailed explanation. But I still have not understood -
> how.
>
> lets say I have a file that has lines of userid, itemid, score
>
> I could found in the documentation a way of feeding it to the recomender.
>
> Best Regards,
> -C.B.
Re: help for item based recommender
Posted by Cam Bazz <ca...@gmail.com>.
Hello Sean,
Thanks a lot for the detailed explanation. But I still have not understood -
how.
lets say I have a file that has lines of userid, itemid, score
I could found in the documentation a way of feeding it to the recomender.
Best Regards,
-C.B.
On Mon, May 26, 2008 at 7:48 PM, Sean Owen <sr...@gmail.com> wrote:
> This is up to you. For item-based recommenders, this is an opportunity
> to inject more information into the recommender, some external notion
> of item-item similarity. For example maybe your items are movies, and
> you define some similarity metric on them based on genre. You can
> implement an ItemCorrelation to encapsulate this, or if you want to
> just pass a fixed list of item-item correlations, use
> GenericItemCorrelation.
>
> An alternative here is to not use GenericItemCorrelation at all, and
> instead pass a PearsonCorrelation. This will compute item-item
> correlations on the fly, based on user preference information.
>
> Isn't that much easier, you ask? yes it's quite easy, and it works.
> You're not adding new information, and are essentially just using a
> user-based recommender turned on its side. That setup is fine -- this
> kind of simple item-based recommender might still be advisable when
> you have a lot of users and few items (user-based recommenders are
> faster when you have few users and many items).
>
> But one of the "features" of item-based recommenders is this notion of
> inserting new information in this way. It's also much faster to use
> fixed similarity information rather than compute it on the fly.
>
> AFAIK this is essentially the approach that Amazon takes.
>
> Why is it asymmetric? why couldn't we suggest that people plug in
> pre-computed notions of user similarity instead? you could... but I
> think that this approach really only makes sense for items. Items are
> fixed, and we may know, a priori, a lot about them, while we start by
> knowing nothing about users and they might even change. So it perhaps
> makes sense that we could reasonably insert external information on
> items, but maybe not for users.
>
> Sean
>
>
> On Mon, May 26, 2008 at 7:58 AM, Cam Bazz <ca...@gmail.com> wrote:
> > Hello,
> >
> > I am going over the documentation and meant to do a item based
> recomender.
> > I understand that the datamodel is fed with triplets in form of:
> >
> > userid, itemid, likingscore
> >
> > There is a part in the code which says:
> >
> > // Construct the list of pre-compted correlations
> > Collection<GenericItemCorrelation.ItemItemCorrelation> correlations =
> > ...;
> > ItemCorrelation itemCorrelation = new
> GenericItemCorrelation(correlations);
> >
> > and the explanation mentions we have to feed a list of pre-computed
> > corelations to the GenericItemCorelation.
> >
> > How do we pre-compute corelations?
> >
> > Best.
> > -C.B.
> >
>
Re: help for item based recommender
Posted by Sean Owen <sr...@gmail.com>.
This is up to you. For item-based recommenders, this is an opportunity
to inject more information into the recommender, some external notion
of item-item similarity. For example maybe your items are movies, and
you define some similarity metric on them based on genre. You can
implement an ItemCorrelation to encapsulate this, or if you want to
just pass a fixed list of item-item correlations, use
GenericItemCorrelation.
An alternative here is to not use GenericItemCorrelation at all, and
instead pass a PearsonCorrelation. This will compute item-item
correlations on the fly, based on user preference information.
Isn't that much easier, you ask? yes it's quite easy, and it works.
You're not adding new information, and are essentially just using a
user-based recommender turned on its side. That setup is fine -- this
kind of simple item-based recommender might still be advisable when
you have a lot of users and few items (user-based recommenders are
faster when you have few users and many items).
But one of the "features" of item-based recommenders is this notion of
inserting new information in this way. It's also much faster to use
fixed similarity information rather than compute it on the fly.
AFAIK this is essentially the approach that Amazon takes.
Why is it asymmetric? why couldn't we suggest that people plug in
pre-computed notions of user similarity instead? you could... but I
think that this approach really only makes sense for items. Items are
fixed, and we may know, a priori, a lot about them, while we start by
knowing nothing about users and they might even change. So it perhaps
makes sense that we could reasonably insert external information on
items, but maybe not for users.
Sean
On Mon, May 26, 2008 at 7:58 AM, Cam Bazz <ca...@gmail.com> wrote:
> Hello,
>
> I am going over the documentation and meant to do a item based recomender.
> I understand that the datamodel is fed with triplets in form of:
>
> userid, itemid, likingscore
>
> There is a part in the code which says:
>
> // Construct the list of pre-compted correlations
> Collection<GenericItemCorrelation.ItemItemCorrelation> correlations =
> ...;
> ItemCorrelation itemCorrelation = new GenericItemCorrelation(correlations);
>
> and the explanation mentions we have to feed a list of pre-computed
> corelations to the GenericItemCorelation.
>
> How do we pre-compute corelations?
>
> Best.
> -C.B.
>