...
Download the Groovy scripting plugin for the KnowledgeFlow here (includes the examples below). From Weka 3.7.2 the Groovy scripting plugin is available as a package called "kfGroovy", which can be downloaded and installed by the package manager. You can also browse the package's details online at: http://weka.sourceforge.net/packageMetaData/kfGroovy/index.html
Requirements
WEKA 3.7.0 or higher.
...