public boolean toARFF(I_DataSet ds, String path) 
    {
	/**
	 * Weka ARFF format example
	 * 
	 * % 1. Title: Iris Plants Database
	 * %
	 * % 2. Sources:
	 * %      (a) Creator: R.A. Fisher
	 * %      (b) Donor: Michael Marshall
	 * %      (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
	 * 
	 * @param ds the {@link I_DataSet} instance to convert.
	 * @return a string representation of the the {@link I_DataSet} object.
	 * @see I_DataSet
	 */

	String header = "% Title : Pulsar Candidates\r% Created using the Decision Tree Classifier\r% Rob Lyon (robert.lyon@cs.man.ac.uk)\r\r";
	String relation = "@RELATION pulsar\r\r";

	String[][] attributes = {
		{"@ATTRIBUTE ","Score1\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score2\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score3\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score4\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score5\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score6\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score7\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score8\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score9\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score10\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score11\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score12\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score13\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score14\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score15\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score16\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score17\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score18\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score19\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score20\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score21\t","NUMERIC\r"},
		{"@ATTRIBUTE ","Score22\t","NUMERIC\r"},
		{"@ATTRIBUTE ","class\t","\t{" + Constants.PULSAR + "," + Constants.NOT_PULSAR + "," + Constants.RFI + "," + Constants.UNKNOWN + "}\r\r"}
	};

	String attribute = "";
	for(int i = 0; i < attributes.length;i++)
	    for(int k = 0; k < attributes[i].length;k++)
		attribute = attribute + attributes[i][k];

	String data = "@DATA\r";

	Writer.write(path, header + relation + attribute + data);

	header = null;
	relation = null;
	attribute = null;
	data = null;
	System.gc();

	String rawData = "";
	String instanceClass = "";
	I_InputPattern p;

	for(int r = 0; r < ds.getRows();r++)
	{
	    if (r % 100 == 0) {System.out.println("Row:"+r); }

	    p = null;
	    p = ds.getDataRow(r);

	    instanceClass = "";
	    instanceClass = p.getClassMembership();
	    double[] d = p.getData();

	    rawData = "";
	    rawData = d[0]+",";
	    for(int k = 1; k < d.length;k++)
		rawData = rawData + d[k] + ",";

	    rawData = rawData + instanceClass + "\r";

	    Writer.write(path , rawData);
	}

	return true;
    }