You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by enrico curiotto <cu...@yahoo.com> on 2012/01/12 01:10:29 UTC

How to update a model

Hello everyone,
I'm new to mahout, to machine learning in general, and to the mailing list
I just started to play with the recommender engine :
I created a FastByIDMap<PreferenceArray>
I put some preferences sample data on it.
Then I created the DataModel:
DataModel model = new GenericDataModel(preferences);


Once the model is "built", how can I update it?
I thought the correct way was with this command:
model.setPreference(long,long,float);

but it throws UnsupportedOperationException.
Any idea?
Thank you in advance,
Enrico

Re: How to update a model [mahout]

Posted by Sean Owen <sr...@gmail.com>.
You can update the file, or add delta files, yes. That's the intended
usage for a file-based model. It's assumed that you're not also
intending to update from the API in this case. Yes you need to make
sure the files are created and updated correctly as you like though
this is a separate issue.

On Thu, Jan 12, 2012 at 11:11 AM, enrico curiotto <cu...@yahoo.com> wrote:
> Thanks for your answers.
> I found that also FileDataModel behaves in the same way, throws
> unsupportedException
> Suppose the scenario in which users want to add their own preferences to the
> model (say FileDataModel) and then get recommendetions. How may I deal with
> it?
> I read about creating "delta files", but if more users access at the same
> time the same FileDataModel I should synchronize it.
> Or perhaps in this scenario it's better to use JdbcDataModel, maybe there
> it's possible to invoke setPreference().
> What's your suggestion in this (typical?) scenario?
> Enrico

Re: How to update a model [mahout]

Posted by enrico curiotto <cu...@yahoo.com>.
Thanks for your answers.
I found that also FileDataModel behaves in the same way, throws unsupportedException
Suppose the scenario in which users want to add their own preferences to the model (say FileDataModel) and then get recommendetions. How may I deal with it?
I read about creating "delta files", but if more users access at the same time the same FileDataModel I should synchronize it.
Or perhaps in this scenario it's better to use JdbcDataModel, maybe there it's possible to invoke setPreference().
What's your suggestion in this (typical?) scenario?
Enrico 



________________________________
 From: Sean Owen <sr...@gmail.com>
To: user@mahout.apache.org 
Cc: enrico curiotto <cu...@yahoo.com> 
Sent: Thursday, January 12, 2012 10:09 AM
Subject: Re: How to update a model
 
Yes I think he's already found this one does not support update. This
model is read-only and so you would re-create a new model on the
updated data as needed. This is intended for use with batch-oriented
updates.

On Thu, Jan 12, 2012 at 1:20 AM, Lance Norskog <go...@gmail.com> wrote:
> Some DataModels support this, some don't. A lot of model algorithms
> work by analyzing the whole input set and building a statistical
> footprint (the 'model'). They don't have algorithms for doing
> incremental changes on the model; they only rebuild from scratch.
>
> You will have to examine the code for the various models to find one
> that supports this.
>
> On Wed, Jan 11, 2012 at 4:10 PM, enrico curiotto <cu...@yahoo.com> wrote:
>> Hello everyone,
>> I'm new to mahout, to machine learning in general, and to the mailing list
>> I just started to play with the recommender engine :
>> I created a FastByIDMap<PreferenceArray>
>> I put some preferences sample data on it.
>> Then I created the DataModel:
>> DataModel model = new GenericDataModel(preferences);
>>
>>
>> Once the model is "built", how can I update it?
>> I thought the correct way was with this command:
>> model.setPreference(long,long,float);
>>
>> but it throws UnsupportedOperationException.
>> Any idea?
>> Thank you in advance,
>> Enrico
>
>
>
> --
> Lance Norskog
> goksron@gmail.com

Re: How to update a model

Posted by Sean Owen <sr...@gmail.com>.
Yes I think he's already found this one does not support update. This
model is read-only and so you would re-create a new model on the
updated data as needed. This is intended for use with batch-oriented
updates.

On Thu, Jan 12, 2012 at 1:20 AM, Lance Norskog <go...@gmail.com> wrote:
> Some DataModels support this, some don't. A lot of model algorithms
> work by analyzing the whole input set and building a statistical
> footprint (the 'model'). They don't have algorithms for doing
> incremental changes on the model; they only rebuild from scratch.
>
> You will have to examine the code for the various models to find one
> that supports this.
>
> On Wed, Jan 11, 2012 at 4:10 PM, enrico curiotto <cu...@yahoo.com> wrote:
>> Hello everyone,
>> I'm new to mahout, to machine learning in general, and to the mailing list
>> I just started to play with the recommender engine :
>> I created a FastByIDMap<PreferenceArray>
>> I put some preferences sample data on it.
>> Then I created the DataModel:
>> DataModel model = new GenericDataModel(preferences);
>>
>>
>> Once the model is "built", how can I update it?
>> I thought the correct way was with this command:
>> model.setPreference(long,long,float);
>>
>> but it throws UnsupportedOperationException.
>> Any idea?
>> Thank you in advance,
>> Enrico
>
>
>
> --
> Lance Norskog
> goksron@gmail.com

Re: How to update a model

Posted by Lance Norskog <go...@gmail.com>.
Some DataModels support this, some don't. A lot of model algorithms
work by analyzing the whole input set and building a statistical
footprint (the 'model'). They don't have algorithms for doing
incremental changes on the model; they only rebuild from scratch.

You will have to examine the code for the various models to find one
that supports this.

On Wed, Jan 11, 2012 at 4:10 PM, enrico curiotto <cu...@yahoo.com> wrote:
> Hello everyone,
> I'm new to mahout, to machine learning in general, and to the mailing list
> I just started to play with the recommender engine :
> I created a FastByIDMap<PreferenceArray>
> I put some preferences sample data on it.
> Then I created the DataModel:
> DataModel model = new GenericDataModel(preferences);
>
>
> Once the model is "built", how can I update it?
> I thought the correct way was with this command:
> model.setPreference(long,long,float);
>
> but it throws UnsupportedOperationException.
> Any idea?
> Thank you in advance,
> Enrico



-- 
Lance Norskog
goksron@gmail.com