mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: Persisting trained models in Mahout
Date Thu, 08 Dec 2011 14:23:37 GMT
This is a fair statement of the traditional way of doing business for
*small* models of the sort used in classification.  The insistence on using
serialization is kind of silly since there are many down-sides to Java
serialization and it is becoming rare for systems that need to serialize
large amounts of data to use Java serialization.

The fact is, however, that this is not general practice with
recommendations.  It is common to do lots of off-line computation that you
could characterize as "learning", and it is common to save the results of
this off-line computation for later deployment, but it is also common to do
the learning on the fly since it is generally pretty trivial stuff.

The earliest examples highlight the simpler approach.  Keep going to see
more interesting examples.

On Thu, Dec 8, 2011 at 6:46 AM, Vinod <pillvin@gmail.com> wrote:

> I'll use the first example from Chapter 2 of your book to clarify what I
> mean by training:-
>
> Following code trains the recommender:-
>    DataModel model = new FileDataModel(new File("intro.csv"));
>
>    UserSimilarity similarity = new PearsonCorrelationSimilarity(model);
>    UserNeighborhood neighborhood =
>      new NearestNUserNeighborhood(2, similarity, model);
>
>    Recommender recommender = new GenericUserBasedRecommender(
>        model, neighborhood, similarity);
>
> At this point, recommender is trained on preferences of users 1 to 5 in
> intro.csv.
>
> We should now be able to serialize() this recommender instance into a file,
> say "Movie Recommender.model" using steps mentioned here (
> http://java.sun.com/developer/technicalArticles/Programming/serialization/
> )
>
> All we need to do now is deploy "Movie Recommender.model" to production.
>
> If I understand the behavior correctly, this model should now be able to
> predict recommendation for a new user.
>

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