if (!m_containsStringAtts) { Instance copy = (Instance) ((Instance) m_subSample[i]).copy(); push(copy, false); // No need to copy instance } else { sb.append(m_subSample[i].toString()).append("\n"); Instances stringSample = new Instances(new StringReader(sb.toString())); for (int i = 0; i < stringSample.numInstances(); i++) { push(stringSample.instance(i), false);
if (!m_containsStringAtts) { Instance copy = (Instance) ((Instance) m_subSample[i]).copy(); push(copy, false); // No need to copy instance } else { sb.append(m_subSample[i].toString()).append("\n"); Instances stringSample = new Instances(new StringReader(sb.toString())); for (int i = 0; i < stringSample.numInstances(); i++) { push(stringSample.instance(i), false);
/** * Input an instance for filtering. Filter requires all training instances be * read before producing output. * * @param instance the input instance * @return true if the filtered instance may now be collected with output(). * @throws IllegalStateException if no input structure has been defined */ @Override public boolean input(Instance instance) { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } if (isFirstBatchDone()) { push(instance); return true; } else { // bufferInput(instance); if (!m_containsStringAtts) { copyValues(instance, false); } processInstance(instance); return false; } }
/** * Input an instance for filtering. Filter requires all training instances be * read before producing output. * * @param instance the input instance * @return true if the filtered instance may now be collected with output(). * @throws IllegalStateException if no input structure has been defined */ @Override public boolean input(Instance instance) { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } if (isFirstBatchDone()) { push(instance); return true; } else { // bufferInput(instance); if (!m_containsStringAtts) { copyValues(instance, false); } processInstance(instance); return false; } }