public String toCSVString(I_DataSet ds)
    {
	String csv = "";

	for(int r = 0; r < ds.getRows();r++)
	{
	    // Get the raw numerical data

	    double[] data = ds.getDataRow(r).getData();

	    // Builds string such that: <pattern name>,<pattern class (if known)>
	    csv = csv + ds.getDataRow(r).getName() + "," +  ds.getDataRow(r).getClassMembership();

	    for(int c = 0; c < data.length; c++)
	    {
		csv = csv + "," + data[c];
	    }

	    csv = csv + ",\n";
	}

	return csv;
    }