@Throws(IOException::class) fun writeBatch() { if (getInstances() == null) { throw IOException("No instances to save") } if (getRetrieval() === INCREMENTAL) { throw IOException("Batch and incremental saving cannot be mixed.") } setRetrieval(BATCH) setWriteMode(WRITE)
 if (retrieveFile() == null && getWriter() == null) { for (i in 0 until getInstances().numInstances()) { System.out.println(instanceToLibsvm(getInstances().instance(i))) } setWriteMode(WAIT) } else { var outW: PrintWriter? = PrintWriter(getWriter()) for (i in 0 until getInstances().numInstances()) { outW.println(instanceToLibsvm(getInstances().instance(i))) } outW.flush() outW.close() setWriteMode(WAIT) outW = null resetWriter() setWriteMode(CANCEL) } }
Writes a Batch of instances