You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Chee Kin Lim <li...@vobject.com> on 2011/12/14 13:04:26 UTC

SlopeOneRecommender and MySQLJDBCDataModel in RecommenderBuilder Implementation

Hi there,

I am writing a Grails plugin for mahout recommender (collaborative
filtering) at the moment. As I am beginner of mahout, I have some doubt for
the implementation of RecommenderBuilder for SlopeOneRecommender and
MySQLJDBCDataModel.

Please see the code at
https://github.com/limcheekin/mahout-recommender/blob/master/src/groovy/org/grails/mahout/recommender/SlopeOneRecommenderBuilder.groovy.
In line 40, I am getting the MySQLJDBCDataModel externally instead of using
the 'dataModel' argument of buildRecommender method.

The reason I do so is I have a hard time to cast the dataModel of
buildRecommender method to appropriate class which use to instantiate
MySQLJDBCDiffStorage
object. Is this solution (getting MySQLJDBCDataModel externally)
appropriate? Kindly let's me know if you have better and more appropriate
solution.

Thanks in advanced.

Best regards,
Chee Kin

Re: SlopeOneRecommender and MySQLJDBCDataModel in RecommenderBuilder Implementation

Posted by Sean Owen <sr...@gmail.com>.
Yes, because the DataModel you receive from the eval framework is certainly
not a MySQL-backed one; it is an artificial one (GenericDataModel) for
testing. If you need to inject a custom DataModel, you need
DataModelBuilder. This may take some work, to push the test data into a
table, create a model, and then clean it up.

Your code does not work as it gives the recommender access to all
information during the test. It will perform perfectly as a result; you're
not actually testing it.

On Wed, Dec 14, 2011 at 12:04 PM, Chee Kin Lim <li...@vobject.com>wrote:

> Hi there,
>
> I am writing a Grails plugin for mahout recommender (collaborative
> filtering) at the moment. As I am beginner of mahout, I have some doubt for
> the implementation of RecommenderBuilder for SlopeOneRecommender and
> MySQLJDBCDataModel.
>
> Please see the code at
>
> https://github.com/limcheekin/mahout-recommender/blob/master/src/groovy/org/grails/mahout/recommender/SlopeOneRecommenderBuilder.groovy
> .
> In line 40, I am getting the MySQLJDBCDataModel externally instead of using
> the 'dataModel' argument of buildRecommender method.
>
> The reason I do so is I have a hard time to cast the dataModel of
> buildRecommender method to appropriate class which use to instantiate
> MySQLJDBCDiffStorage
> object. Is this solution (getting MySQLJDBCDataModel externally)
> appropriate? Kindly let's me know if you have better and more appropriate
> solution.
>
> Thanks in advanced.
>
> Best regards,
> Chee Kin
>

Re: SlopeOneRecommender and MySQLJDBCDataModel in RecommenderBuilder Implementation

Posted by Chee Kin Lim <li...@vobject.com>.
Hi Sean Owen,

I did subscribed to user <at> mahout.apache.org, but I forgot reply for
confirmation. The problem solved.

Thanks for further helpful response. I have better understanding now.

Best regards,
Chee Kin


On Tue, Dec 20, 2011 at 10:32 PM, Chee Kin Lim <li...@vobject.com>wrote:

> Hi Sean Owen,
>
> Thanks for quick response and sorry for late response (I am a bit
> surprised that
> I didn't received your response in my mail box, not even in spam folder).
> I saw your response at
> http://comments.gmane.org/gmane.comp.apache.mahout.user/10901
>
> I don't understand your meaning of "It will perform perfectly as a result;
> you're not actually testing it."
>
> Is that means I need to implement  MySQLDataModelBuilder which will return
> GenericDataModel?
>
> Please advice.
>
> Regards,
> Chee Kin
>
>
>
> On Wed, Dec 14, 2011 at 8:04 PM, Chee Kin Lim <li...@vobject.com>wrote:
>
>> Hi there,
>>
>> I am writing a Grails plugin for mahout recommender (collaborative
>> filtering) at the moment. As I am beginner of mahout, I have some doubt for
>> the implementation of RecommenderBuilder for SlopeOneRecommender and
>> MySQLJDBCDataModel.
>>
>> Please see the code at
>> https://github.com/limcheekin/mahout-recommender/blob/master/src/groovy/org/grails/mahout/recommender/SlopeOneRecommenderBuilder.groovy.
>> In line 40, I am getting the MySQLJDBCDataModel externally instead of using
>> the 'dataModel' argument of buildRecommender method.
>>
>> The reason I do so is I have a hard time to cast the dataModel of
>> buildRecommender method to appropriate class which use to instantiate MySQLJDBCDiffStorage
>> object. Is this solution (getting MySQLJDBCDataModel externally)
>> appropriate? Kindly let's me know if you have better and more appropriate
>> solution.
>>
>> Thanks in advanced.
>>
>> Best regards,
>> Chee Kin
>
>
>

Re: SlopeOneRecommender and MySQLJDBCDataModel in RecommenderBuilder Implementation

Posted by Sean Owen <sr...@gmail.com>.
(You may not be subscribed to user@mahout.apache.org then?)

I mean that you cannot ignore the DataModel that the eval framework gives
you, and go use your own. You will invalidate the whole test, since your
data model has all the "answers" that the test is testing! It's like
handing your students the answer key before an exam. Sure, they'll all
finish the test. All will score 100%. But that is not a successful test!

You do need to implement DataModelBuilder, if you need to return a special
DataModel.

On Tue, Dec 20, 2011 at 2:32 PM, Chee Kin Lim <li...@vobject.com>wrote:

> Hi Sean Owen,
>
> Thanks for quick response and sorry for late response (I am a bit surprised
> that
> I didn't received your response in my mail box, not even in spam folder). I
> saw your response at
> http://comments.gmane.org/gmane.comp.apache.mahout.user/10901
>
> I don't understand your meaning of "It will perform perfectly as a result;
> you're not actually testing it."
>
> Is that means I need to implement  MySQLDataModelBuilder which will return
> GenericDataModel?
>
> Please advice.
>
> Regards,
> Chee Kin
>
>

Re: SlopeOneRecommender and MySQLJDBCDataModel in RecommenderBuilder Implementation

Posted by Chee Kin Lim <li...@vobject.com>.
Hi Sean Owen,

Thanks for quick response and sorry for late response (I am a bit surprised
that
I didn't received your response in my mail box, not even in spam folder). I
saw your response at
http://comments.gmane.org/gmane.comp.apache.mahout.user/10901

I don't understand your meaning of "It will perform perfectly as a result;
you're not actually testing it."

Is that means I need to implement  MySQLDataModelBuilder which will return
GenericDataModel?

Please advice.

Regards,
Chee Kin


On Wed, Dec 14, 2011 at 8:04 PM, Chee Kin Lim <li...@vobject.com>wrote:

> Hi there,
>
> I am writing a Grails plugin for mahout recommender (collaborative
> filtering) at the moment. As I am beginner of mahout, I have some doubt for
> the implementation of RecommenderBuilder for SlopeOneRecommender and
> MySQLJDBCDataModel.
>
> Please see the code at
> https://github.com/limcheekin/mahout-recommender/blob/master/src/groovy/org/grails/mahout/recommender/SlopeOneRecommenderBuilder.groovy.
> In line 40, I am getting the MySQLJDBCDataModel externally instead of using
> the 'dataModel' argument of buildRecommender method.
>
> The reason I do so is I have a hard time to cast the dataModel of
> buildRecommender method to appropriate class which use to instantiate MySQLJDBCDiffStorage
> object. Is this solution (getting MySQLJDBCDataModel externally)
> appropriate? Kindly let's me know if you have better and more appropriate
> solution.
>
> Thanks in advanced.
>
> Best regards,
> Chee Kin