User Tools

Site Tools


tuto_ecj_weka

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tuto_ecj_weka [2014/03/03 16:33]
Denis Pallez [Running the algorithm and get the results]
tuto_ecj_weka [2014/03/03 16:48] (current)
Denis Pallez [Conclusion]
Line 391: Line 391:
 See weka's documentation for a full explanation on how to perform option handling and make it available in the GUI. See weka's documentation for a full explanation on how to perform option handling and make it available in the GUI.
  
-Now your options are fully available. I built a complete exemple at [[http://​pighetti.atlasiens.fr/​tutorials/​using-ecj-in-weka/​src/​weka/​clusterers/​EcjBasedClusterer.java|weka.clusterers.EcjBasedClusterer]]+Now your options are fully available. I built a complete exemple at {{:ecj_weka_fichiers:​ecjbasedclusterer.java|weka.clusterers.EcjBasedClusterer.java}}
  
 ===== Calling the ECJ algorithm: ===== ===== Calling the ECJ algorithm: =====
Line 420: Line 420:
 There you are, the algorithm runs with the parameters file you specified in weka options for your clusterer and you got the results back at the end of the computation. There you are, the algorithm runs with the parameters file you specified in weka options for your clusterer and you got the results back at the end of the computation.
  
 +<note important>​
 The parameters array given to the run method must contains the same thing as if you were calling **Evolve** from the command line. Don't forget that when calling from the command line the first argument in the array is the name of the command typed. Here i left it blanks because its not read at any time. But it can be discarded or ignored so i prefer having one empty string at the begining of the array and specify the options in the rest of the array. The parameters array given to the run method must contains the same thing as if you were calling **Evolve** from the command line. Don't forget that when calling from the command line the first argument in the array is the name of the command typed. Here i left it blanks because its not read at any time. But it can be discarded or ignored so i prefer having one empty string at the begining of the array and specify the options in the rest of the array.
 +</​note>​
  
 If you want to load from a checkpoint, you don't need to set the learning data. I mentioned that the data given by weka to ecj are placed in a manner that allow them to be save when checkpointing. So when resuming, the data previously saved are restored and used to complete the evolution process. If new data are given, they are ignored. Here is a bit of code showing how to launch an algorithm from a checkpoint file: If you want to load from a checkpoint, you don't need to set the learning data. I mentioned that the data given by weka to ecj are placed in a manner that allow them to be save when checkpointing. So when resuming, the data previously saved are restored and used to complete the evolution process. If new data are given, they are ignored. Here is a bit of code showing how to launch an algorithm from a checkpoint file:
Line 435: Line 437:
 Now you should be able to construct simple Clusterer for weka using an ECJ algorithm. Practising these two softwares, you should then be able to build more complicated things. The class **weka.clusterer.ECJBasedClusterer** shows an exemple of clusterer taking two parameters, one string for an ECJ parameters file and another string for an ECJ checkpoint file. The last one overrides the first one if both are given. Then the clusterer does nothing in its buildClassifier method and it always returns 0 for the cluster. It's useless as a clusterer, the goal is just to show the overall construction of a clusterer with some options. Now you should be able to construct simple Clusterer for weka using an ECJ algorithm. Practising these two softwares, you should then be able to build more complicated things. The class **weka.clusterer.ECJBasedClusterer** shows an exemple of clusterer taking two parameters, one string for an ECJ parameters file and another string for an ECJ checkpoint file. The last one overrides the first one if both are given. Then the clusterer does nothing in its buildClassifier method and it always returns 0 for the cluster. It's useless as a clusterer, the goal is just to show the overall construction of a clusterer with some options.
  
-This class is available at: [[http://​pighetti.atlasiens.fr/​tutorials/​using-ecj-in-weka/​src/​weka/​clusterers/​EcjBasedClusterer.java|src/​weka/​clusterers/​EcjBasedClusterer.java]].+This class is available at: {{:ecj_weka_fichiers:​ecjbasedclusterer.java|src/​weka/​clusterers/​EcjBasedClusterer.java}}.
  
 Be aware that even if this exemple shows only how to build a clusterer, the work to build a classifier or an associator is fairly the same. You just need to change the base class used in weka and construct an algorithm for classification instead of clusterisation. Be aware that even if this exemple shows only how to build a clusterer, the work to build a classifier or an associator is fairly the same. You just need to change the base class used in weka and construct an algorithm for classification instead of clusterisation.
Line 441: Line 443:
 In conclusion, the capabilities of this interaction between ECJ and weka only depends on the algorithm you're writting with ECJ and the use of the results your doing in weka. In conclusion, the capabilities of this interaction between ECJ and weka only depends on the algorithm you're writting with ECJ and the use of the results your doing in weka.
  
-Rédigé par Romaric ​pighetti. Janvier ​2012.+<​note>​written by Romaric ​Pighetti in 2012/01.</​note>​
tuto_ecj_weka.1393860817.txt.gz · Last modified: 2014/03/03 16:33 by Denis Pallez