You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by mishkinf <mi...@hotmail.com> on 2009/08/13 21:03:23 UTC
Mahout not giving recommendations with large data sets
I have been using mahout-0.1 release version and I am able to get
recommendations with datasets roughly 5 million and under but when I attempt
10 million or so no recommendations are given to me. Has anybody had this
problem? I'm not sure if I am just using the wrong recommender
settings/recommender or if I should just switch to trunk version or
something. Ideas? Suggestions?
I have tried item-item recommender, user-item recommenders.... nearest
neighborhood... tree clustering..
They all produce numerous recommendations with the smaller data sets. In
theory it should only get better with a larger data set.
Currently I'm using item-item recommender with caching item similarities and
cashing recommender..
ItemSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
CachingItemSimilarity cis = new CachingItemSimilarity(similarity,
dataModel);
recommender = new CachingRecommender(new
GenericItemBasedRecommender(dataModel, similarity));
......
I would like to have Mahout to work with 25-50 million rows of data but as
of yet 5 million is the best i can do. RAM has also been an issue with
larger data sets.
--
View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24956912.html
Sent from the Mahout User List mailing list archive at Nabble.com.
Re: Mahout not giving recommendations with large data sets
Posted by Sean Owen <sr...@gmail.com>.
I committed a change just now that would catch this situation -- too
many delimiters, or, an empty field.
While some of my improvements improve slope-one, I haven't completed
an overhaul of that code yet.
On Tue, Aug 18, 2009 at 7:40 PM, mishkinf<mi...@hotmail.com> wrote:
>
> You were right! At least pretty close. My file data model was not loading the
> last chunk of the line which had all the ratings! So everything just got a
> default value of 1 I guess. Thanks for the tip.
>
> Now I will try test it with a much bigger data file and see what sorts of
> results I get.
Re: Mahout not giving recommendations with large data sets
Posted by mishkinf <mi...@hotmail.com>.
You were right! At least pretty close. My file data model was not loading the
last chunk of the line which had all the ratings! So everything just got a
default value of 1 I guess. Thanks for the tip.
Now I will try test it with a much bigger data file and see what sorts of
results I get.
srowen wrote:
>
> On Tue, Aug 18, 2009 at 6:32 PM, mishkinf<mi...@hotmail.com> wrote:
>>
>> First off let me note I have upgraded to Mahout 0.2. Well at the moment
>> I
>> have a dataset of about 6 million right now and I have no trouble with
>> that
>> data set giving results using the slopeone grouplens example (but I have
>> downloaded your changes and I will test with much larger datasets soon).
>> Let
>> me back up though. First I used the "1 million grouplens" data and the
>> results work perfectly. The slopeone recommender used in the default
>> grouplens code returns a list of recommendations perfectly. Then I take
>> my
>> data which is 6 million rows (in the same exact format) and place it in
>> the
>> system and I get a bunch of recommendations BUT all of the scores for the
>> recommendations are "1" and thus the same recommendations are made no
>> matter
>> the user since i assume all recommendations share the same score.
>
> Hmm, are you using a DataModel that discards the preference values?
> what kind of model is it? in that case yes you would only ever get "1"
> as an estimated preference -- it's meaningless. Slope-one doesn't work
> at all in this case (well, the result is as you say some random result
> that is fixed for everyone).
>
> So from what you say so far it sounds like the issue is your DataModel
> is one that does not include preference values. The source GroupLens
> data does have it.
>
>
>> Could this be because my dataset is very sparse or something? I mean in
>> terms of difference between the grouplens data and mine all I can see is
>> that the grouplens data starts from the number 1 for users whereas my
>> userids are all about 8 or 9 digits long and I also don't have a
>> timestamp
>> but otherwise same format... which as far as I see shouldn't matter.
>
> Yeah this doesn't matter at all. What exactly is your data file like?
> it needs to be delimited by commas or tabs, that sort of thing, not
> double-colons. I'm wondering if that could somehow be the issue...
>
>
--
View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p25031035.html
Sent from the Mahout User List mailing list archive at Nabble.com.
Re: Mahout not giving recommendations with large data sets
Posted by Sean Owen <sr...@gmail.com>.
On Tue, Aug 18, 2009 at 6:32 PM, mishkinf<mi...@hotmail.com> wrote:
>
> First off let me note I have upgraded to Mahout 0.2. Well at the moment I
> have a dataset of about 6 million right now and I have no trouble with that
> data set giving results using the slopeone grouplens example (but I have
> downloaded your changes and I will test with much larger datasets soon). Let
> me back up though. First I used the "1 million grouplens" data and the
> results work perfectly. The slopeone recommender used in the default
> grouplens code returns a list of recommendations perfectly. Then I take my
> data which is 6 million rows (in the same exact format) and place it in the
> system and I get a bunch of recommendations BUT all of the scores for the
> recommendations are "1" and thus the same recommendations are made no matter
> the user since i assume all recommendations share the same score.
Hmm, are you using a DataModel that discards the preference values?
what kind of model is it? in that case yes you would only ever get "1"
as an estimated preference -- it's meaningless. Slope-one doesn't work
at all in this case (well, the result is as you say some random result
that is fixed for everyone).
So from what you say so far it sounds like the issue is your DataModel
is one that does not include preference values. The source GroupLens
data does have it.
> Could this be because my dataset is very sparse or something? I mean in
> terms of difference between the grouplens data and mine all I can see is
> that the grouplens data starts from the number 1 for users whereas my
> userids are all about 8 or 9 digits long and I also don't have a timestamp
> but otherwise same format... which as far as I see shouldn't matter.
Yeah this doesn't matter at all. What exactly is your data file like?
it needs to be delimited by commas or tabs, that sort of thing, not
double-colons. I'm wondering if that could somehow be the issue...
Re: Mahout not giving recommendations with large data sets
Posted by mishkinf <mi...@hotmail.com>.
And just to make sure I just reduced my same dataset from 6 million to 1
million just like the functional grouplens dataset.... and it produced the
same "1" score for all recommended items and all usersids. so it must be
something specific about this data. either its too sparse or something..
mishkinf wrote:
>
> First off let me note I have upgraded to Mahout 0.2. Well at the moment I
> have a dataset of about 6 million right now and I have no trouble with
> that data set giving results using the slopeone grouplens example (but I
> have downloaded your changes and I will test with much larger datasets
> soon). Let me back up though. First I used the "1 million grouplens" data
> and the results work perfectly. The slopeone recommender used in the
> default grouplens code returns a list of recommendations perfectly. Then I
> take my data which is 6 million rows (in the same exact format) and place
> it in the system and I get a bunch of recommendations BUT all of the
> scores for the recommendations are "1" and thus the same recommendations
> are made no matter the user since i assume all recommendations share the
> same score.
>
> Could this be because my dataset is very sparse or something? I mean in
> terms of difference between the grouplens data and mine all I can see is
> that the grouplens data starts from the number 1 for users whereas my
> userids are all about 8 or 9 digits long and I also don't have a timestamp
> but otherwise same format... which as far as I see shouldn't matter.
>
> format:
> userid::itemid::score
>
> if I figure out the issue I will keep you posted.
>
>
> srowen wrote:
>>
>> PS I just fixed a bug that might cause the problem you see. It
>> resulted in an infinite loop in some cases, and I could imagine that
>> it only came up when data sets get a little larger. try the latest
>> from subversion to see if it helps.
>>
>> On Thu, Aug 13, 2009 at 8:03 PM, mishkinf<mi...@hotmail.com> wrote:
>>>
>>> I have been using mahout-0.1 release version and I am able to get
>>> recommendations with datasets roughly 5 million and under but when I
>>> attempt
>>> 10 million or so no recommendations are given to me. Has anybody had
>>> this
>>> problem? I'm not sure if I am just using the wrong recommender
>>> settings/recommender or if I should just switch to trunk version or
>>> something. Ideas? Suggestions?
>>>
>>> I have tried item-item recommender, user-item recommenders.... nearest
>>> neighborhood... tree clustering..
>>> They all produce numerous recommendations with the smaller data sets. In
>>> theory it should only get better with a larger data set.
>>>
>>> Currently I'm using item-item recommender with caching item similarities
>>> and
>>> cashing recommender..
>>>
>>> ItemSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
>>> CachingItemSimilarity cis = new CachingItemSimilarity(similarity,
>>> dataModel);
>>> recommender = new CachingRecommender(new
>>> GenericItemBasedRecommender(dataModel, similarity));
>>>
>>> ......
>>>
>>> I would like to have Mahout to work with 25-50 million rows of data but
>>> as
>>> of yet 5 million is the best i can do. RAM has also been an issue with
>>> larger data sets.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24956912.html
>>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p25030090.html
Sent from the Mahout User List mailing list archive at Nabble.com.
Re: Mahout not giving recommendations with large data sets
Posted by mishkinf <mi...@hotmail.com>.
First off let me note I have upgraded to Mahout 0.2. Well at the moment I
have a dataset of about 6 million right now and I have no trouble with that
data set giving results using the slopeone grouplens example (but I have
downloaded your changes and I will test with much larger datasets soon). Let
me back up though. First I used the "1 million grouplens" data and the
results work perfectly. The slopeone recommender used in the default
grouplens code returns a list of recommendations perfectly. Then I take my
data which is 6 million rows (in the same exact format) and place it in the
system and I get a bunch of recommendations BUT all of the scores for the
recommendations are "1" and thus the same recommendations are made no matter
the user since i assume all recommendations share the same score.
Could this be because my dataset is very sparse or something? I mean in
terms of difference between the grouplens data and mine all I can see is
that the grouplens data starts from the number 1 for users whereas my
userids are all about 8 or 9 digits long and I also don't have a timestamp
but otherwise same format... which as far as I see shouldn't matter.
format:
userid::itemid::score
if I figure out the issue I will keep you posted.
srowen wrote:
>
> PS I just fixed a bug that might cause the problem you see. It
> resulted in an infinite loop in some cases, and I could imagine that
> it only came up when data sets get a little larger. try the latest
> from subversion to see if it helps.
>
> On Thu, Aug 13, 2009 at 8:03 PM, mishkinf<mi...@hotmail.com> wrote:
>>
>> I have been using mahout-0.1 release version and I am able to get
>> recommendations with datasets roughly 5 million and under but when I
>> attempt
>> 10 million or so no recommendations are given to me. Has anybody had this
>> problem? I'm not sure if I am just using the wrong recommender
>> settings/recommender or if I should just switch to trunk version or
>> something. Ideas? Suggestions?
>>
>> I have tried item-item recommender, user-item recommenders.... nearest
>> neighborhood... tree clustering..
>> They all produce numerous recommendations with the smaller data sets. In
>> theory it should only get better with a larger data set.
>>
>> Currently I'm using item-item recommender with caching item similarities
>> and
>> cashing recommender..
>>
>> ItemSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
>> CachingItemSimilarity cis = new CachingItemSimilarity(similarity,
>> dataModel);
>> recommender = new CachingRecommender(new
>> GenericItemBasedRecommender(dataModel, similarity));
>>
>> ......
>>
>> I would like to have Mahout to work with 25-50 million rows of data but
>> as
>> of yet 5 million is the best i can do. RAM has also been an issue with
>> larger data sets.
>> --
>> View this message in context:
>> http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24956912.html
>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p25029772.html
Sent from the Mahout User List mailing list archive at Nabble.com.
Re: Mahout not giving recommendations with large data sets
Posted by Sean Owen <sr...@gmail.com>.
PS I just fixed a bug that might cause the problem you see. It
resulted in an infinite loop in some cases, and I could imagine that
it only came up when data sets get a little larger. try the latest
from subversion to see if it helps.
On Thu, Aug 13, 2009 at 8:03 PM, mishkinf<mi...@hotmail.com> wrote:
>
> I have been using mahout-0.1 release version and I am able to get
> recommendations with datasets roughly 5 million and under but when I attempt
> 10 million or so no recommendations are given to me. Has anybody had this
> problem? I'm not sure if I am just using the wrong recommender
> settings/recommender or if I should just switch to trunk version or
> something. Ideas? Suggestions?
>
> I have tried item-item recommender, user-item recommenders.... nearest
> neighborhood... tree clustering..
> They all produce numerous recommendations with the smaller data sets. In
> theory it should only get better with a larger data set.
>
> Currently I'm using item-item recommender with caching item similarities and
> cashing recommender..
>
> ItemSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
> CachingItemSimilarity cis = new CachingItemSimilarity(similarity,
> dataModel);
> recommender = new CachingRecommender(new
> GenericItemBasedRecommender(dataModel, similarity));
>
> ......
>
> I would like to have Mahout to work with 25-50 million rows of data but as
> of yet 5 million is the best i can do. RAM has also been an issue with
> larger data sets.
> --
> View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24956912.html
> Sent from the Mahout User List mailing list archive at Nabble.com.
>
>
Re: Mahout not giving recommendations with large data sets
Posted by Sean Owen <sr...@gmail.com>.
Yes, an item-based recommender is better -- slope-one is also
reasonable. Slope one takes more precomputation to start up but is
likely faster at runtime. Also, try LogLikelihoodSimilarity. If you
find it actually gives better results, that's good news. It doesn't
even use rating values, so, you would then be able to drop that part
of your data.
Yes the GroupLens example is still there and updated for the new changes.
I am still quite puzzled about not getting recommendations. Are you
doing any sampling in any part of the code? that is if using less and
less of the data as it grows, in order to scale, maybe at some point
you are omitting so much data that it's sparse enough that many
similarities can't be computed.
On Thu, Aug 13, 2009 at 11:56 PM, mishkinf<mi...@hotmail.com> wrote:
>
> Well in fact it is strange because I have the same data set and when it is 5
> million lines it produces a number of recommendation results then when it is
> more it simply returns no results but does not run into memory exceptions or
> anything abnormal that is bring printed on the console. This confused me.
>
> My dad is basically of the form -1 to 1. I am looking at a list of purchased
> items aka..
> <userid> <itemid> <# times purchased>
> but then I run a normalization algorithm on it so the data returned is
> actually
> <userid> <itemid> <value -1 to 1>
>
> In terms of users vs products. I'm looking at much much more users than
> products (millions/thousands). And users are always growing too. This is why
> I was thinking item based recommenders were good.
>
> This normalized data is the data I feed to mahout. I basically modified the
> GroupLens example and that has been what I was working off of. If that
> example exists in the 0.2 version it might be worth my while to upgrade.
>
Re: Mahout not giving recommendations with large data sets
Posted by mishkinf <mi...@hotmail.com>.
Well in fact it is strange because I have the same data set and when it is 5
million lines it produces a number of recommendation results then when it is
more it simply returns no results but does not run into memory exceptions or
anything abnormal that is bring printed on the console. This confused me.
My dad is basically of the form -1 to 1. I am looking at a list of purchased
items aka..
<userid> <itemid> <# times purchased>
but then I run a normalization algorithm on it so the data returned is
actually
<userid> <itemid> <value -1 to 1>
In terms of users vs products. I'm looking at much much more users than
products (millions/thousands). And users are always growing too. This is why
I was thinking item based recommenders were good.
This normalized data is the data I feed to mahout. I basically modified the
GroupLens example and that has been what I was working off of. If that
example exists in the 0.2 version it might be worth my while to upgrade.
srowen wrote:
>
> One thing I can tell you is that mahout-0.2 will be significantly
> faster and use less memory. On one particular setup I am working on
> with a client, we needed 1GB heap to hold 5M ratings in memory, and
> needed about 1 second to generate recommendations. After recent
> changes, it fits in 360M and takes about 0.3s to generate a
> recommendation.
>
> The catch is that most APIs changed significantly. You'll have to do
> some work to adapt to the new code. It is available now from
> Subversion, and I would welcome anyone who is willing to try it out,
> as it is a big change and still quite new.
>
>
> Do you mean it fails when the data set gets larger, or you get a
> return value, it just has no recommendations? That latter result would
> be very puzzling. Is that what you see?
>
>
> Beyond this, I think your system could be 'tuned' more by selecting
> perhaps faster, more specific implementations to use. For example,
> tell me about the nature of your 'ratings' in your system. In many
> cases, it's actually better (and much faster) to completely ignore
> ratings. There is support for that in the framework.
>
>
> On Thu, Aug 13, 2009 at 8:03 PM, mishkinf<mi...@hotmail.com> wrote:
>>
>> I have been using mahout-0.1 release version and I am able to get
>> recommendations with datasets roughly 5 million and under but when I
>> attempt
>> 10 million or so no recommendations are given to me. Has anybody had this
>> problem? I'm not sure if I am just using the wrong recommender
>> settings/recommender or if I should just switch to trunk version or
>> something. Ideas? Suggestions?
>>
>> I have tried item-item recommender, user-item recommenders.... nearest
>> neighborhood... tree clustering..
>> They all produce numerous recommendations with the smaller data sets. In
>> theory it should only get better with a larger data set.
>>
>> Currently I'm using item-item recommender with caching item similarities
>> and
>> cashing recommender..
>>
>> ItemSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
>> CachingItemSimilarity cis = new CachingItemSimilarity(similarity,
>> dataModel);
>> recommender = new CachingRecommender(new
>> GenericItemBasedRecommender(dataModel, similarity));
>>
>> ......
>>
>> I would like to have Mahout to work with 25-50 million rows of data but
>> as
>> of yet 5 million is the best i can do. RAM has also been an issue with
>> larger data sets.
>> --
>> View this message in context:
>> http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24956912.html
>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24961458.html
Sent from the Mahout User List mailing list archive at Nabble.com.
Re: Mahout not giving recommendations with large data sets
Posted by Sean Owen <sr...@gmail.com>.
One thing I can tell you is that mahout-0.2 will be significantly
faster and use less memory. On one particular setup I am working on
with a client, we needed 1GB heap to hold 5M ratings in memory, and
needed about 1 second to generate recommendations. After recent
changes, it fits in 360M and takes about 0.3s to generate a
recommendation.
The catch is that most APIs changed significantly. You'll have to do
some work to adapt to the new code. It is available now from
Subversion, and I would welcome anyone who is willing to try it out,
as it is a big change and still quite new.
Do you mean it fails when the data set gets larger, or you get a
return value, it just has no recommendations? That latter result would
be very puzzling. Is that what you see?
Beyond this, I think your system could be 'tuned' more by selecting
perhaps faster, more specific implementations to use. For example,
tell me about the nature of your 'ratings' in your system. In many
cases, it's actually better (and much faster) to completely ignore
ratings. There is support for that in the framework.
On Thu, Aug 13, 2009 at 8:03 PM, mishkinf<mi...@hotmail.com> wrote:
>
> I have been using mahout-0.1 release version and I am able to get
> recommendations with datasets roughly 5 million and under but when I attempt
> 10 million or so no recommendations are given to me. Has anybody had this
> problem? I'm not sure if I am just using the wrong recommender
> settings/recommender or if I should just switch to trunk version or
> something. Ideas? Suggestions?
>
> I have tried item-item recommender, user-item recommenders.... nearest
> neighborhood... tree clustering..
> They all produce numerous recommendations with the smaller data sets. In
> theory it should only get better with a larger data set.
>
> Currently I'm using item-item recommender with caching item similarities and
> cashing recommender..
>
> ItemSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
> CachingItemSimilarity cis = new CachingItemSimilarity(similarity,
> dataModel);
> recommender = new CachingRecommender(new
> GenericItemBasedRecommender(dataModel, similarity));
>
> ......
>
> I would like to have Mahout to work with 25-50 million rows of data but as
> of yet 5 million is the best i can do. RAM has also been an issue with
> larger data sets.
> --
> View this message in context: http://www.nabble.com/Mahout-not-giving-recommendations-with-large-data-sets-tp24956912p24956912.html
> Sent from the Mahout User List mailing list archive at Nabble.com.
>
>