File format of ARFF


Updated by Fengfeng Zhou, 2011-11-22

The file format ARFF is used by the data mining software, Weka. And here are some links to the description of the file format:
  1. Attribute-Relation File Format (ARFF): http://www.cs.waikato.ac.nz/ml/weka/arff.html
  2. The wikispaces version: http://weka.wikispaces.com/ARFF

The software, Weka, can be downloaded from: http://www.cs.waikato.ac.nz/ml/weka/

One example of a simple ARFF file is:

 
% 1. Title: Iris Plants Database
%
% 2. Sources:
% (a) Creator: R.A. Fisher
% (b) Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov)
% (c) Date: July, 1988
%
@RELATION iris

@ATTRIBUTE sepallength NUMERIC
@ATTRIBUTE sepalwidth NUMERIC
@ATTRIBUTE petallength NUMERIC
@ATTRIBUTE petalwidth NUMERIC
@ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica}

@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa

 

My new version of the ARFF file format is to add the sample name for each line in the "@DATA" section.

 
% 1. Title: Iris Plants Database
%
% 2. Sources:
% (a) Creator: R.A. Fisher
% (b) Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov)
% (c) Date: July, 1988
%
@RELATION iris

@ATTRIBUTE sepallength NUMERIC
@ATTRIBUTE sepalwidth NUMERIC
@ATTRIBUTE petallength NUMERIC
@ATTRIBUTE petalwidth NUMERIC
@ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica}

@DATA
5.1,3.5,1.4,0.2,Iris-setosa % SampleID-1; other comment information
4.9,3.0,1.4,0.2,Iris-setosa % SampleID-2; other comment information
4.7,3.2,1.3,0.2,Iris-setosa % SampleID-3; other comment information
4.6,3.1,1.5,0.2,Iris-setosa % SampleID-4; other comment information
5.0,3.6,1.4,0.2,Iris-setosa % SampleID-5; other comment information
5.4,3.9,1.7,0.4,Iris-setosa % SampleID-6; other comment information
4.6,3.4,1.4,0.3,Iris-setosa % SampleID-7; other comment information
5.0,3.4,1.5,0.2,Iris-setosa % SampleID-8; other comment information
4.4,2.9,1.4,0.2,Iris-setosa % SampleID-9; other comment information
4.9,3.1,1.5,0.1,Iris-setosa % SampleID-10; other comment information