You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Brian Arnold <ba...@gmail.com> on 2013/09/11 23:18:47 UTC
Item Based Collaborative Filtering Properties Question
Hi,
I am currently trying to run the distributed Item Based Collaborative
filtering algorithm on our Hadoop cluster, and I have a few questions
regarding tweaking the various properties of the algorithm. For the
maxPrefsPerUser,maxSimilaritiesPerItem, and maxPrefsPerUserItemSimilarity
properties I was wondering if I could get a more detailed explanation of
what these properties control. I saw the description in the code, but I am
just wondering how changing these values will affect the results of the
algorithm, and will increasing them result in a better recommendation.
Thanks
Re: Item Based Collaborative Filtering Properties Question
Posted by Brian Arnold <ba...@gmail.com>.
Hey Sebastian,
Thanks for all the information, that was very helpful. One question, when
you said "as large as the maximum number of interactions per user or
larger" for the macPrefsPerUser property does that refer if the algorithm
was comparing your items and my items it would be looking at how many of
all of our items we have in common? So if we both have 500 items total, 100
of which are in common in both sets, would the maxPrefsPerUser property cap
how many items it looks at of that 100 in common? You said this should be
set to a very high number, however, in the code it appears this value is
defaulted to 10. What do you consider very high; 100, 1,000, 10,000? We
are currently using 0.7 because that is what came with our version of HDP.
Should we upgrade to trunk of 0.8? Would we gain any performance
improvements or algorithm improvements?
Thanks so much!
Brian
On Thu, Sep 12, 2013 at 11:01 AM, Sebastian Schelter <ss...@apache.org> wrote:
> Hi Brian,
>
> Happy to give you some details:
> So, from a matrix A (user x item) that holds user-item interactions,
> this algorithm first computes a matrix S (item x item) of item
> similarities and afterwards uses these item similarities to compute
> recommendations for users.
>
> the parameters refer to the following:
>
> 'maxPrefsPerUserInItemSimilarity' the maximum number of interactions per
> user to take into account when computing S (e.g. the maximum number of
> entries to look at per row in A, selected at random). Single power-users
> with an anomalous number of interactions can heavily increase the
> computation time, without contributing to the actual quality of the
> output. Setting this to something like 500 should give you reasonable
> performance and results.
>
> 'maxSimilaritiesPerItem' this number determines the maximum number of
> similar items to look at per item (e.g. the maximum number of entries
> per row in S). Research papers reported good results with something
> between 20 and 100.
>
> 'maxPrefsPerUser': this number determines how many interactions per user
> to take into account in the final recommendation phase. This thing is
> probably bugged and should be set to a very high number (as large as the
> maximum number of interactions per user or larger) otherwise you might
> see items in the recommendations that the user already knows.
>
> In general, the only way to get a picture of the quality of a
> recommender is by doing tests in a live system with real users. You can
> of course do some hold-out tests or cross-validation offline, but good
> performance there does not necessarily correlate with good performance
> in a real system.
>
> I suggest you start by using the default values, do you use trunk or 0.8?
>
> Best,
> Sebastian
>
>
>
> 2013/9/11 Brian Arnold <ba...@gmail.com>
>
> > Hi,
> >
> > I am currently trying to run the distributed Item Based Collaborative
> > filtering algorithm on our Hadoop cluster, and I have a few questions
> > regarding tweaking the various properties of the algorithm. For the
> > maxPrefsPerUser,maxSimilaritiesPerItem, and maxPrefsPerUserItemSimilarity
> > properties I was wondering if I could get a more detailed explanation of
> > what these properties control. I saw the description in the code, but I
> am
> > just wondering how changing these values will affect the results of the
> > algorithm, and will increasing them result in a better recommendation.
> >
> > Thanks
> >
>
>
>
Re: Item Based Collaborative Filtering Properties Question
Posted by Sebastian Schelter <ss...@apache.org>.
Hi Brian,
Happy to give you some details:
So, from a matrix A (user x item) that holds user-item interactions,
this algorithm first computes a matrix S (item x item) of item
similarities and afterwards uses these item similarities to compute
recommendations for users.
the parameters refer to the following:
'maxPrefsPerUserInItemSimilarity' the maximum number of interactions per
user to take into account when computing S (e.g. the maximum number of
entries to look at per row in A, selected at random). Single power-users
with an anomalous number of interactions can heavily increase the
computation time, without contributing to the actual quality of the
output. Setting this to something like 500 should give you reasonable
performance and results.
'maxSimilaritiesPerItem' this number determines the maximum number of
similar items to look at per item (e.g. the maximum number of entries
per row in S). Research papers reported good results with something
between 20 and 100.
'maxPrefsPerUser': this number determines how many interactions per user
to take into account in the final recommendation phase. This thing is
probably bugged and should be set to a very high number (as large as the
maximum number of interactions per user or larger) otherwise you might
see items in the recommendations that the user already knows.
In general, the only way to get a picture of the quality of a
recommender is by doing tests in a live system with real users. You can
of course do some hold-out tests or cross-validation offline, but good
performance there does not necessarily correlate with good performance
in a real system.
I suggest you start by using the default values, do you use trunk or 0.8?
Best,
Sebastian
2013/9/11 Brian Arnold <ba...@gmail.com>
> Hi,
>
> I am currently trying to run the distributed Item Based Collaborative
> filtering algorithm on our Hadoop cluster, and I have a few questions
> regarding tweaking the various properties of the algorithm. For the
> maxPrefsPerUser,maxSimilaritiesPerItem, and maxPrefsPerUserItemSimilarity
> properties I was wondering if I could get a more detailed explanation of
> what these properties control. I saw the description in the code, but I am
> just wondering how changing these values will affect the results of the
> algorithm, and will increasing them result in a better recommendation.
>
> Thanks
>
Re: Item Based Collaborative Filtering Properties Question
Posted by 林伟 <li...@gmail.com>.
Hi Brain,
The parameter "maxPrefsPerUserInItemSimilarity" is in RecommenderJob, from
the text of comment, It is the same as the paramter "maxPrefsPerUser " in
ItemSimilarityJob.
The second question is not easy to answer. It is decided by your
recommendation scenario and input data features. The most important is the
quality of you data (for example , the accuracy of prefer value), not these
parameters. These parameters are more relate to the performance of
similarity calculation.
Thanks.
2013/9/12 Brian Arnold <ba...@gmail.com>
> Hi,
>
> Thank you for the response! What you said makes sense. Here is a link to
> the other property:
>
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.mahout/mahout-core/0.6/org/apache/mahout/cf/taste/hadoop/item/RecommenderJob.java#RecommenderJob.0DEFAULT_MAX_SIMILARITIES_PER_ITEM
>
> Supposing I have a sufficiently large cluster to process the data, would
> increasing the values necessarily give me a better recommendation? Which
> do you feel would have the largest impact on the quality of the
> recommendation?
>
> Brian
>
>
> On Thu, Sep 12, 2013 at 7:05 AM, 林伟 <li...@gmail.com> wrote:
>
> > Hi Brian *& *Miliauskas,
> >
> > I am a data mining engineer form Taobao recommendation team. In past one
> > month, I have read all the code of mahout itemCF.
> > So maybe I can answer this question.
> >
> > We consider the input of itemCF for one user is a item vector, like this
> > (the notation is from Json object model):
> > <userid, [ {item1, perf(u, i1)}, {item2, perf(u, i2)}, ..... {itemN,
> > perf(u, in)} ]>
> > So, maxPrefsPerUser means max length of item vector. If
> > user preferred more than this number items, there a sample will be
> applied
> > the make sure the limitation.
> >
> > We also consider the output of ItemCF for one item is a similarity
> vector,
> > like this:
> > <item1, [ {item2, sim(2,1}, {item3, sim(3,1), .... {itemK, sim(K,1)} ]>
> > So, maxSimilaritiesPerItem means max length of similarity vector, if
> > item1 has more similar items than this number, mahout just output top
> > 'maxSimilaritiesPerItem'
> > items.
> >
> > For parameter 'maxPrefsPerUserItemSimilarity', I haven't find it. Can
> you
> > give me a link to find it.
> >
> > Thanks
> >
> >
> >
> > 2013/9/12 Darius Miliauskas <da...@gmail.com>
> >
> > > Hi, Brian,
> > >
> > > this question is also relevant for me. Perhaps somebody will give more
> > > details because I am just learning myself. But, I guess you can try to
> > > change the parameters, and check the performance, and write here about
> it
> > > that everybody would get more knowledge!
> > >
> > > In general, if these values are lower, the performance should be faster
> > > because mahout based on some algorithms of hadoop. I think it could
> help
> > if
> > > you will try the algorithms with several pieces of data, and look if
> you
> > > are missing some important recommendations. Let's say if you choose "
> > > maxSimilaritiesPerItem" as 4, and you miss some recommendations, then
> you
> > > should increase the value. It is a balance between performance and
> better
> > > results, and you should find that balance. Hope, you to share more
> > details
> > > about what you will find out because I noticed that here (in the
> mailing
> > > list of mahout) everybody is asking but only few replying, and sharing.
> > >
> > >
> > > Thanks,
> > >
> > > Darius
> > >
> > >
> > > 2013/9/12 Brian Arnold <ba...@gmail.com>
> > >
> > > > Hi,
> > > >
> > > > I am currently trying to run the distributed Item Based Collaborative
> > > > filtering algorithm on our Hadoop cluster, and I have a few questions
> > > > regarding tweaking the various properties of the algorithm. For the
> > > > maxPrefsPerUser,maxSimilaritiesPerItem, and
> > maxPrefsPerUserItemSimilarity
> > > > properties I was wondering if I could get a more detailed explanation
> > of
> > > > what these properties control. I saw the description in the code,
> but
> > I
> > > am
> > > > just wondering how changing these values will affect the results of
> the
> > > > algorithm, and will increasing them result in a better
> recommendation.
> > > >
> > > > Thanks
> > > >
> > >
> >
>
Re: Item Based Collaborative Filtering Properties Question
Posted by Brian Arnold <ba...@gmail.com>.
Hi,
Thank you for the response! What you said makes sense. Here is a link to
the other property:
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.mahout/mahout-core/0.6/org/apache/mahout/cf/taste/hadoop/item/RecommenderJob.java#RecommenderJob.0DEFAULT_MAX_SIMILARITIES_PER_ITEM
Supposing I have a sufficiently large cluster to process the data, would
increasing the values necessarily give me a better recommendation? Which
do you feel would have the largest impact on the quality of the
recommendation?
Brian
On Thu, Sep 12, 2013 at 7:05 AM, 林伟 <li...@gmail.com> wrote:
> Hi Brian *& *Miliauskas,
>
> I am a data mining engineer form Taobao recommendation team. In past one
> month, I have read all the code of mahout itemCF.
> So maybe I can answer this question.
>
> We consider the input of itemCF for one user is a item vector, like this
> (the notation is from Json object model):
> <userid, [ {item1, perf(u, i1)}, {item2, perf(u, i2)}, ..... {itemN,
> perf(u, in)} ]>
> So, maxPrefsPerUser means max length of item vector. If
> user preferred more than this number items, there a sample will be applied
> the make sure the limitation.
>
> We also consider the output of ItemCF for one item is a similarity vector,
> like this:
> <item1, [ {item2, sim(2,1}, {item3, sim(3,1), .... {itemK, sim(K,1)} ]>
> So, maxSimilaritiesPerItem means max length of similarity vector, if
> item1 has more similar items than this number, mahout just output top
> 'maxSimilaritiesPerItem'
> items.
>
> For parameter 'maxPrefsPerUserItemSimilarity', I haven't find it. Can you
> give me a link to find it.
>
> Thanks
>
>
>
> 2013/9/12 Darius Miliauskas <da...@gmail.com>
>
> > Hi, Brian,
> >
> > this question is also relevant for me. Perhaps somebody will give more
> > details because I am just learning myself. But, I guess you can try to
> > change the parameters, and check the performance, and write here about it
> > that everybody would get more knowledge!
> >
> > In general, if these values are lower, the performance should be faster
> > because mahout based on some algorithms of hadoop. I think it could help
> if
> > you will try the algorithms with several pieces of data, and look if you
> > are missing some important recommendations. Let's say if you choose "
> > maxSimilaritiesPerItem" as 4, and you miss some recommendations, then you
> > should increase the value. It is a balance between performance and better
> > results, and you should find that balance. Hope, you to share more
> details
> > about what you will find out because I noticed that here (in the mailing
> > list of mahout) everybody is asking but only few replying, and sharing.
> >
> >
> > Thanks,
> >
> > Darius
> >
> >
> > 2013/9/12 Brian Arnold <ba...@gmail.com>
> >
> > > Hi,
> > >
> > > I am currently trying to run the distributed Item Based Collaborative
> > > filtering algorithm on our Hadoop cluster, and I have a few questions
> > > regarding tweaking the various properties of the algorithm. For the
> > > maxPrefsPerUser,maxSimilaritiesPerItem, and
> maxPrefsPerUserItemSimilarity
> > > properties I was wondering if I could get a more detailed explanation
> of
> > > what these properties control. I saw the description in the code, but
> I
> > am
> > > just wondering how changing these values will affect the results of the
> > > algorithm, and will increasing them result in a better recommendation.
> > >
> > > Thanks
> > >
> >
>
Re: Item Based Collaborative Filtering Properties Question
Posted by 林伟 <li...@gmail.com>.
Hi Brian *& *Miliauskas,
I am a data mining engineer form Taobao recommendation team. In past one
month, I have read all the code of mahout itemCF.
So maybe I can answer this question.
We consider the input of itemCF for one user is a item vector, like this
(the notation is from Json object model):
<userid, [ {item1, perf(u, i1)}, {item2, perf(u, i2)}, ..... {itemN,
perf(u, in)} ]>
So, maxPrefsPerUser means max length of item vector. If
user preferred more than this number items, there a sample will be applied
the make sure the limitation.
We also consider the output of ItemCF for one item is a similarity vector,
like this:
<item1, [ {item2, sim(2,1}, {item3, sim(3,1), .... {itemK, sim(K,1)} ]>
So, maxSimilaritiesPerItem means max length of similarity vector, if
item1 has more similar items than this number, mahout just output top
'maxSimilaritiesPerItem'
items.
For parameter 'maxPrefsPerUserItemSimilarity', I haven't find it. Can you
give me a link to find it.
Thanks
2013/9/12 Darius Miliauskas <da...@gmail.com>
> Hi, Brian,
>
> this question is also relevant for me. Perhaps somebody will give more
> details because I am just learning myself. But, I guess you can try to
> change the parameters, and check the performance, and write here about it
> that everybody would get more knowledge!
>
> In general, if these values are lower, the performance should be faster
> because mahout based on some algorithms of hadoop. I think it could help if
> you will try the algorithms with several pieces of data, and look if you
> are missing some important recommendations. Let's say if you choose "
> maxSimilaritiesPerItem" as 4, and you miss some recommendations, then you
> should increase the value. It is a balance between performance and better
> results, and you should find that balance. Hope, you to share more details
> about what you will find out because I noticed that here (in the mailing
> list of mahout) everybody is asking but only few replying, and sharing.
>
>
> Thanks,
>
> Darius
>
>
> 2013/9/12 Brian Arnold <ba...@gmail.com>
>
> > Hi,
> >
> > I am currently trying to run the distributed Item Based Collaborative
> > filtering algorithm on our Hadoop cluster, and I have a few questions
> > regarding tweaking the various properties of the algorithm. For the
> > maxPrefsPerUser,maxSimilaritiesPerItem, and maxPrefsPerUserItemSimilarity
> > properties I was wondering if I could get a more detailed explanation of
> > what these properties control. I saw the description in the code, but I
> am
> > just wondering how changing these values will affect the results of the
> > algorithm, and will increasing them result in a better recommendation.
> >
> > Thanks
> >
>
Re: Item Based Collaborative Filtering Properties Question
Posted by Darius Miliauskas <da...@gmail.com>.
Hi, Brian,
this question is also relevant for me. Perhaps somebody will give more
details because I am just learning myself. But, I guess you can try to
change the parameters, and check the performance, and write here about it
that everybody would get more knowledge!
In general, if these values are lower, the performance should be faster
because mahout based on some algorithms of hadoop. I think it could help if
you will try the algorithms with several pieces of data, and look if you
are missing some important recommendations. Let's say if you choose "
maxSimilaritiesPerItem" as 4, and you miss some recommendations, then you
should increase the value. It is a balance between performance and better
results, and you should find that balance. Hope, you to share more details
about what you will find out because I noticed that here (in the mailing
list of mahout) everybody is asking but only few replying, and sharing.
Thanks,
Darius
2013/9/12 Brian Arnold <ba...@gmail.com>
> Hi,
>
> I am currently trying to run the distributed Item Based Collaborative
> filtering algorithm on our Hadoop cluster, and I have a few questions
> regarding tweaking the various properties of the algorithm. For the
> maxPrefsPerUser,maxSimilaritiesPerItem, and maxPrefsPerUserItemSimilarity
> properties I was wondering if I could get a more detailed explanation of
> what these properties control. I saw the description in the code, but I am
> just wondering how changing these values will affect the results of the
> algorithm, and will increasing them result in a better recommendation.
>
> Thanks
>