/** * Signify that this batch of input to the filter is finished. If the filter * requires all instances prior to filtering, output() may now be called to * retrieve the filtered instances. * * @return true if there are instances pending output * @throws Exception if no input structure has been defined */ @Override public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new Exception("No input instance format defined"); } // Do the subsample, and clear the input instances. addNoise(getInputFormat(), m_RandomSeed, m_Percent, m_AttIndex.getIndex(), m_UseMissing); for (int i = 0; i < getInputFormat().numInstances(); i++) { push((Instance) getInputFormat().instance(i).copy(), false); // No need to copy instance } flushInput(); m_NewBatch = true; m_FirstBatchDone = true; return (numPendingOutput() != 0); }
/** * Signify that this batch of input to the filter is finished. If the filter * requires all instances prior to filtering, output() may now be called to * retrieve the filtered instances. * * @return true if there are instances pending output * @throws Exception if no input structure has been defined */ @Override public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new Exception("No input instance format defined"); } // Do the subsample, and clear the input instances. addNoise(getInputFormat(), m_RandomSeed, m_Percent, m_AttIndex.getIndex(), m_UseMissing); for (int i = 0; i < getInputFormat().numInstances(); i++) { push((Instance) getInputFormat().instance(i).copy(), false); // No need to copy instance } flushInput(); m_NewBatch = true; m_FirstBatchDone = true; return (numPendingOutput() != 0); }