public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); * getInputFormat().numInstances()); m_dictionaryBuilder.setPeriodicPruning(pruneRate); for (int i = 0; i < getInputFormat().numInstances(); i++) { Instance toProcess = getInputFormat().instance(i); m_dictionaryBuilder.processInstance(toProcess); Instances converted = m_dictionaryBuilder.vectorizeBatch( getInputFormat(), m_filterType != FILTER_NONE);
public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); * getInputFormat().numInstances()); m_dictionaryBuilder.setPeriodicPruning(pruneRate); for (int i = 0; i < getInputFormat().numInstances(); i++) { Instance toProcess = getInputFormat().instance(i); m_dictionaryBuilder.processInstance(toProcess); Instances converted = m_dictionaryBuilder.vectorizeBatch( getInputFormat(), m_filterType != FILTER_NONE);
/** * 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) throws Exception { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } if (isFirstBatchDone()) { Instance inst = m_dictionaryBuilder.vectorizeInstance(instance); push(inst, false); // No need to copy return true; } else { bufferInput(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) throws Exception { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (m_NewBatch) { resetQueue(); m_NewBatch = false; } if (isFirstBatchDone()) { Instance inst = m_dictionaryBuilder.vectorizeInstance(instance); push(inst, false); // No need to copy return true; } else { bufferInput(instance); return false; } }