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 <[email protected]>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 >
