public String toStringArff() { StringBuilder text = new StringBuilder(); text.append(ARFF_RELATION).append(" ") .append(Utils.quote(getRelationName())).append("\n\n"); for (int i = 0; i < numAttributes(); i++) { text.append(attribute(i).toString()).append("\n"); } text.append("\n").append(ARFF_DATA).append("\n"); text.append(toString()); return text.toString(); } }
/** * Returns the dataset as a string in ARFF format. Strings are quoted if * they contain whitespace characters, or if they are a question mark. * * @return the dataset in ARFF format as a string */ public String toString() { StringBuffer text = new StringBuffer(); text.append(ARFF_RELATION).append(" "). append(Utils.quote(this.instanceInformation.getRelationName())).append("\n\n"); for (int i = 0; i < numAttributes(); i++) { text.append(attribute(i).toString()).append("\n"); } text.append("\n").append(ARFF_DATA).append("\n"); text.append(stringWithoutHeader()); return text.toString(); }