|Table of Content Zone|
The ARFF output plugin is a tool that allows you to output data from Kettle to a file in WEKA's Attribute Relation File Format (ARFF). ARFF format is essentially the same as comma separated values (CSV) format, except with the addition of meta data on the attributes (fields) in the form of a header. Here is an example ARFF file:
2 Getting Started
In order to use the ARFF output plugin, it must first be installed correctly in Kettle---unpack the plugin archive and copy all files in the ArffOutputDeploy directory to a sub-directory in the plugins/steps directory of your Kettle installation. You will also need a current version of WEKA available as a library to Kettle. Download WEKA 3.5.6 (or later) from SourceForge, unpack the archive, and copy the "weka.jar" file to the same sub-directory in plugins/steps as before. Now start Spoon. Confirm that the plugin has been installed and correctly recognized by Kettle by expanding the "Output" list under "Core Objects" in Spoon. You should see ARFF output listed in bold near the bottom of the list.
3 Configuring the ARFF Output Step
Assuming that you have the ARFF output step connected to a previous step, double click on its icon to open the configuration dialog.
4 Choosing a Filename and Relation Name
Type a filename into the provided text area on the "File" tab, or use the "Browse" button to navigate through your file system. Enter a relation name for the new ARFF file in the "Relation name" text field.
5 Choosing a File Format and Character Encoding
File format (Unix or DOS) and character encoding can be selected on the "Content" tab. The default format is DOS and the default character encoding is platform-dependent.
5 Review the Mapping between Kettle and ARFF types
The mapping between incoming Kettle field types and the ARFF attribute types that will be written to the file is shown in the "Fields" tab. Any obvious problems here can be rectified by modifying the meta data for the Kettle types in a previous step. The ARFF output step maps Kettle "String" type to ARFF "nominal", "Number" and "Integer" to "numeric", and "Date" to "date". All formatting and precision encoded in the Kettle meta data is respected by the ARFF output step.
In this tab you can also specify that the weight for each row (instance) in the ARFF file should be set by using the values from an incoming Kettle field. If this option is not selected, then by default each instance in the ARFF file receives a weight of 1. Standard ARFF format can support instance-level weights from Weka 3.5.8 onwards.