/** * Generates a comment header. * * @return the header */ protected String matlabHeader() { StringBuffer result; int i; result = new StringBuffer(); result.append("% Relation: " + getInstances().relationName() + "\n"); result.append("% Generated on: " + new Date() + "\n"); result.append("% Generated by: WEKA " + Version.VERSION + "\n"); result.append("%\n"); result.append("% "); for (i = 0; i < getInstances().numAttributes(); i++) { if (i > 0) { result.append((m_UseTabs ? "\t " : " ")); } result.append(Utils.padRight(getInstances().attribute(i).name(), (m_UseDouble ? 16 : 8) + 5)); } return result.toString(); }
/** * Generates a comment header. * * @return the header */ protected String matlabHeader() { StringBuffer result; int i; result = new StringBuffer(); result.append("% Relation: " + getInstances().relationName() + "\n"); result.append("% Generated on: " + new Date() + "\n"); result.append("% Generated by: WEKA " + Version.VERSION + "\n"); result.append("%\n"); result.append("% "); for (i = 0; i < getInstances().numAttributes(); i++) { if (i > 0) { result.append((m_UseTabs ? "\t " : " ")); } result.append(Utils.padRight(getInstances().attribute(i).name(), (m_UseDouble ? 16 : 8) + 5)); } return result.toString(); }
if (getInstances() == null) { throw new IOException("No instances to save"); for (int i = 0; i < getInstances().numInstances(); i++) { System.out.println(instanceToMatlab(getInstances().instance(i))); PrintWriter outW = new PrintWriter(getWriter()); outW.println(matlabHeader()); for (int i = 0; i < getInstances().numInstances(); i++) { outW.println(instanceToMatlab(getInstances().instance(i)));
if (getInstances() == null) { throw new IOException("No instances to save"); for (int i = 0; i < getInstances().numInstances(); i++) { System.out.println(instanceToMatlab(getInstances().instance(i))); PrintWriter outW = new PrintWriter(getWriter()); outW.println(matlabHeader()); for (int i = 0; i < getInstances().numInstances(); i++) { outW.println(instanceToMatlab(getInstances().instance(i)));
public void writeIncremental(Instance inst) throws IOException { int writeMode = getWriteMode(); Instances structure = getInstances(); PrintWriter outW = null;
public void writeIncremental(Instance inst) throws IOException { int writeMode = getWriteMode(); Instances structure = getInstances(); PrintWriter outW = null;