Hi Jamey,

On 29.11.2011, at 18:50, Jamey Wood wrote:

> Thanks for the response, Manuel.  But what I'm asking about here is a way
> to _set_ a time when storing a preference into a DataModel (i.e. control
> the value that'll subsequently be returned by the getPreferenceTime method).

Actually as far as I know this is not possible. The GenericDataModel has the 
ability to read time preferences during construction:
https://builds.apache.org/job/Mahout-Quality/javadoc/org/apache/mahout/cf/taste/impl/model/GenericDataModel.html#GenericDataModel(org.apache.mahout.cf.taste.impl.common.FastByIDMap,
 org.apache.mahout.cf.taste.impl.common.FastByIDMap)

Further it is very unlikely that you set the preferences through the DataModel. 
Normally you read the preferences from another system and the other system is 
responsible to update them.

If you have your own implementation you could provide an own method for also 
setting a time preference.

As far as I now there are currently no recommenders which use the time for 
recommendation. At the moment there is some discussion about adding 
recommenders which are able to find seasons or other timed data.

> 
> Thanks,
> Jamey

/Manuel

> 
> On Tue, Nov 29, 2011 at 10:41 AM, Manuel Blechschmidt <
> [email protected]> wrote:
> 
>> Hi Jamey,
>> 
>> On 29.11.2011, at 18:32, Jamey Wood wrote:
>> 
>>> It seems a bit surprising that there is no method along these lines in
>>> DataModel (or some subclass thereof):
>>> 
>>> setPreference(long userID, long itemID, float value, long time)
>>> 
>>> Am I just overlooking something?
>> 
>> Yes you do, here you go:
>> 
>> https://builds.apache.org/job/Mahout-Quality/javadoc/org/apache/mahout/cf/taste/model/DataModel.html#getPreferenceTime(long,
>> long)
>> 
>> Actually this does not support multiple times like Reratings or multiple
>> User Interactions. Nevertheless you get the preference time.
>> 
>>> Are you always expected to just go in
>>> "under the covers" of some DataModel's implementation details to do this
>>> (such as a raw SQL insert for a JDBC-based DataModel)?
>>> 
>>> Thanks,
>>> Jamey
>> 
>> 
>> /Manuel
>> 
>> --
>> Manuel Blechschmidt
>> Dortustr. 57
>> 14467 Potsdam
>> Mobil: 0173/6322621
>> Twitter: http://twitter.com/Manuel_B
>> 
>> 

-- 
Manuel Blechschmidt
Dortustr. 57
14467 Potsdam
Mobil: 0173/6322621
Twitter: http://twitter.com/Manuel_B

Reply via email to