Return-Path: Delivered-To: apmail-lucene-mahout-commits-archive@locus.apache.org Received: (qmail 21261 invoked from network); 17 Aug 2008 15:04:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Aug 2008 15:04:57 -0000 Received: (qmail 9791 invoked by uid 500); 17 Aug 2008 15:04:56 -0000 Delivered-To: apmail-lucene-mahout-commits-archive@lucene.apache.org Received: (qmail 9759 invoked by uid 500); 17 Aug 2008 15:04:56 -0000 Mailing-List: contact mahout-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mahout-dev@lucene.apache.org Delivered-To: mailing list mahout-commits@lucene.apache.org Received: (qmail 9750 invoked by uid 99); 17 Aug 2008 15:04:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Aug 2008 08:04:56 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Aug 2008 15:04:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 11D57234C1B2 for ; Sun, 17 Aug 2008 08:04:00 -0700 (PDT) Message-ID: <142468662.1218985440071.JavaMail.www-data@brutus> Date: Sun, 17 Aug 2008 08:04:00 -0700 (PDT) From: confluence@apache.org To: mahout-commits@lucene.apache.org Subject: [CONF] Apache Lucene Mahout: Watchmaker.GA.Tutorial (page edited) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Watchmaker.GA.Tutorial (MAHOUT) edited by abdelhakim deneche Page: http://cwiki.apache.org/confluence/display/MAHOUT/Watchmaker.GA.Tutorial Changes: http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=93002&originalVersion=1&revisedVersion=2 Content: --------------------------------------------------------------------- h1. How to distribute the fitness evaluation using Mahout.GA In any Watchmaker program, you'll have to create an instance of a StandaloneEvolutionEngine. For the TSP example this is done in the EvolutionaryTravellingSalesman class: {code:java} private EvolutionEngine> getEngine(CandidateFactory> candidateFactory, EvolutionaryOperator> pipeline, Random rng) { return new StandaloneEvolutionEngine>(candidateFactory, pipeline, new RouteEvaluator(distances), selectionStrategy, rng); } {code} The RouteEvaluator class is where the fitness of each individual is evaluated, if we want to distribute the evaluation over a Hadoop Cluster, all we have to is wrap the evaluator in a MahoutFitnessEvaluator, and instead of a StandaloneEvolutionEngine we'll use a STEvolutionEngine : {code:java} private EvolutionEngine> getEngine(CandidateFactory> candidateFactory, EvolutionaryOperator> pipeline, Random rng) { MahoutFitnessEvaluator> evaluator = new MahoutFitnessEvaluator>(new RouteEvaluator(distances)); return new STEvolutionEngine>(candidateFactory, pipeline, evaluator, selectionStrategy, rng); } {code} And voila! your code is ready to run on Hadoop. The complete running example is available with the examples in the org/apache/mahout/ga/watchmaker/travellingsalesman directory --------------------------------------------------------------------- CONFLUENCE INFORMATION This message is automatically generated by Confluence Unsubscribe or edit your notifications preferences http://cwiki.apache.org/confluence/users/viewnotifications.action If you think it was sent incorrectly contact one of the administrators http://cwiki.apache.org/confluence/administrators.action If you want more information on Confluence, or have a bug to report see http://www.atlassian.com/software/confluence