You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Thomas Rewig <tr...@mufin.com> on 2009/07/14 11:58:54 UTC

Re: Memory and Speed Questions for Item-Based-Recommender

Sean Owen schrieb:
> On Mon, Jul 13, 2009 at 2:48 PM, Thomas Rewig<tr...@mufin.com> wrote:
>   
>>        *** "Pre"-Recommender ***
>>       // set the model for the ItemItemMatrix
>>       this.similarityModel = new MySQLJDBCDataModel(cPoolDS,
>> preferenceTable, userIDColumn, itemIDColumn, preferenceColumn);
>>     
>
>   
>>       // set the model for the Recommender
>>       this.model = new MySQLJDBCDataModel(cPoolDS, preferenceTable,
>> userIDColumn, itemIDColumn, preferenceColumn);
>>     
>
> Hmm, this doesn't look right. You are using the exact same table and
> columns in both cases. I thought that above, your "users" were items
> and "items" were item attributes, and in the second case, your "users"
> are actual users and "items" are items.
>
>   
Oh sorry, I just copy the code snippets, actually thats all several 
methods controlled by a controller ... the tables and columns are not 
the same, I just haven't been attentive and adjust this for the example. 
My fault sorry.

>>           // Cast to itemSimilarity because the "Users" in the
>> "Pre"-Recommender are Items
>>       this.cachingItemSimilarity = (CachingItemSimilarity)
>> this.cachingUserSimilarity;
>>     
>
> I don't understand why you are trying to do this? there are two
> classes available, CachingItemSimilarity and CachingUserSimilarity.
> There should be no need to force one to be the other.
Because I need a UserSimilarity to precompute. Maybe I overlook a 
importent detail, but if I do it in that way to compute all on the fly 
in a item-based way:

        *** "Pre"-Recommender ***
        // set the model for the ItemItemMatrix
       this.similarityModel = new MySQLJDBCDataModel(cPoolDS, 
preferenceTableSim, userIDColumnSim, itemIDColumnSim, preferenceColumnSim);
        // set the "ItemSimilarity" for the ItemItemMatrix
       this.similarityItemSimilarity = new 
EuclideanDistanceSimilarity(this.similarityModel);
        // set CaschingSimilarity
       this.cachingItemSimilarity = new 
CachingItemSimilarity(this.similarityItemSimilarity, this.similarityModel);
        *** Recommender ***
       // set the model for the Recommender
       this.model = new MySQLJDBCDataModel(cPoolDS, preferenceTable, 
userIDColumn, itemIDColumn, preferenceColumn);
       // set the Recommender with the *cachingItemSimilarity*
       this.recommender = new GenericUserBasedRecommender(this.model, 
this.cachingItemSimilarity);

Here I get a recommender for the users based at the 
*item-attributes*-similarity from the pre-recommender-model and that 
won't make sense because I need the *item*-similarity from the 
pre-recommender-model. The item-similarity of the pre-recommender I can 
only compute with a UserSimilarity, but I can't get a UserSimilarity in 
a CaschingItemSimilarity respectively the ItemBasedRecommender. Where is 
my mistake?

Anyway I can precompute with taste the item-item-matrix in a first step. 
And in a second step I can recommend with that matrix and the userdata 
other items to a user. To do that all "on the fly" isn't so importent at 
the moment.

I think I will test a little bit with lucene as Ted suggested to 
increase the speed of step two. That sounds very interesting.

Thomas


Re: Memory and Speed Questions for Item-Based-Recommender

Posted by Thomas Rewig <tr...@mufin.com>.
Sean Owen schrieb:
> On Tue, Jul 14, 2009 at 10:58 AM, Thomas Rewig<tr...@mufin.com> wrote:
>   
>> Because I need a UserSimilarity to precompute. Maybe I overlook a importent
>> detail, but if I do it in that way to compute all on the fly in a item-based
>> way:
>>
>>       *** "Pre"-Recommender ***
>>       // set the model for the ItemItemMatrix
>>      this.similarityModel = new MySQLJDBCDataModel(cPoolDS,
>> preferenceTableSim, userIDColumnSim, itemIDColumnSim, preferenceColumnSim);
>>       // set the "ItemSimilarity" for the ItemItemMatrix
>>      this.similarityItemSimilarity = new
>> EuclideanDistanceSimilarity(this.similarityModel);
>>       // set CaschingSimilarity
>>      this.cachingItemSimilarity = new
>> CachingItemSimilarity(this.similarityItemSimilarity, this.similarityModel);
>>       *** Recommender ***
>>      // set the model for the Recommender
>>      this.model = new MySQLJDBCDataModel(cPoolDS, preferenceTable,
>> userIDColumn, itemIDColumn, preferenceColumn);
>>      // set the Recommender with the *cachingItemSimilarity*
>>      this.recommender = new GenericUserBasedRecommender(this.model,
>> this.cachingItemSimilarity);
>>     
>
> But why are you using a user-based recommender here? I thought you
> were using an item-based recommender, in the end, to produce actual
> recommendations. Yes, of course you do not plug in an item-similarity
> metric into a user-based recommender.
>
> User GenericItemBasedRecommender.
>   
Oh I think I need a coffee ... in my code it is a 
GenericItemBasedRecommender, I have to improve my copy&paste ...

this.recommender = new GenericItemBasedRecommender(this.model,this.cachingItemSimilarity);


Re: Memory and Speed Questions for Item-Based-Recommender

Posted by Sean Owen <sr...@gmail.com>.
On Tue, Jul 14, 2009 at 10:58 AM, Thomas Rewig<tr...@mufin.com> wrote:
> Because I need a UserSimilarity to precompute. Maybe I overlook a importent
> detail, but if I do it in that way to compute all on the fly in a item-based
> way:
>
>       *** "Pre"-Recommender ***
>       // set the model for the ItemItemMatrix
>      this.similarityModel = new MySQLJDBCDataModel(cPoolDS,
> preferenceTableSim, userIDColumnSim, itemIDColumnSim, preferenceColumnSim);
>       // set the "ItemSimilarity" for the ItemItemMatrix
>      this.similarityItemSimilarity = new
> EuclideanDistanceSimilarity(this.similarityModel);
>       // set CaschingSimilarity
>      this.cachingItemSimilarity = new
> CachingItemSimilarity(this.similarityItemSimilarity, this.similarityModel);
>       *** Recommender ***
>      // set the model for the Recommender
>      this.model = new MySQLJDBCDataModel(cPoolDS, preferenceTable,
> userIDColumn, itemIDColumn, preferenceColumn);
>      // set the Recommender with the *cachingItemSimilarity*
>      this.recommender = new GenericUserBasedRecommender(this.model,
> this.cachingItemSimilarity);

But why are you using a user-based recommender here? I thought you
were using an item-based recommender, in the end, to produce actual
recommendations. Yes, of course you do not plug in an item-similarity
metric into a user-based recommender.

User GenericItemBasedRecommender.