mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceyhun Can √úLKER <>
Subject Changing in-memory DataModel to a DB dependent only DataModel after building recommender
Date Mon, 21 Jan 2013 19:54:35 GMT

In our application we are using ReloadFromJDBCDataModel for its speed
advantage of in-memory representation and being able to update periodically
to pull in new data from a database source.

However, once the recommender is build we do not want to keep the ratings
data in memory (we would like to query the database when rating data is
needed). We want to replace the ReloadFromJDBCDataModel with a
MySqlJDBCDataModel after build. But there is no setter method for it,
furthermore, the field that keeps the DataModel is in AbstractRecommender
(superclass of SVDRecommender) and it is declared final.

We thought we could write a new class that derives from DataModel, which
initial keeps a Reload model instance (let's call this delegateModel), has
a setter method for it, and delegates all DataModel methods, so that we
could set this delegateModel field to another instance, say
MySqlJDBCDataModel instance. Is this a good method for removing in-memory
representation dependency after the build process?

How can we achieve this change? Or is there an alternative and better way
to achieve this?

Ceyhun Can Ulker

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message