====== How to build weka classifiers using ECJ library, the faster way ? ====== A detailed version is available [[tuto_ecj_weka|here]]. ===== Prerequisites: ===== * Weka and knowledge about how to write algorithms in weka. * ECJ and knowledge about how it works. * This tutorial jarfile available {{:ecj_weka_fichiers:ecj-for-weka.jar|here}}. ===== Class diagram: ===== Here is a short diagram representing what is contained in the jar file and how it is connected to ECJ's core. {{:ecj_weka_fichiers:ecj_mods_dgrm.png?|}} ===== Usage: ===== For your ECJ Algorithm: - Use a derived class of ec.weka.EvolutionStateForWeka as EvolutionState for your algorithm. - Use a derived class of ec.weka.StatisticsForWeka for the Statistics class of your algorithm. - When building parts of your algorithm you can call the getLearningDataSet method to get a weka.Core.Instance object containing a set of data that must be given by your weka algorithm (if you need it). When building your algorithm in weka, ou will launch your ecj algorithm by creating an ec.weka.Evolve object. Then you can call the setLearningDataSet method on it, giving it an Instances object, if your weka algorithm needs any data. Finally, to launch the algorithm you'll call the run method on the Evolve object, giving it the same argument you would give when invoking the algorithm from the command line. This mehod will return the results of the computation as an Individual[][] representing the best individuals of each subpopulation for each job. You can use these results as you wish within your weka algorithm. written by Romaric Pighetti in 2012/01.