/** * 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 Exception if an error occurs * @throws IllegalStateException if no input format has been set. */ @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 (m_MinArray == null) { bufferInput(instance); return false; } else { convertInstance(instance); return true; } }
/** * 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 Exception if an error occurs * @throws IllegalStateException if no input format has been set. */ @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 (m_MinArray == null) { bufferInput(instance); return false; } else { convertInstance(instance); return true; } }
if (getInputFormat() != null) { setInputFormat(getInputFormat());
if (getInputFormat() != null) { setInputFormat(getInputFormat());
if (instance.attribute(j).isNumeric() && (!Utils.isMissingValue(vals[j])) && (getInputFormat().classIndex() != j)) { if (Double.isNaN(m_MinArray[j]) || (m_MaxArray[j] == m_MinArray[j])) { value = 0; } else { double[] vals = instance.toDoubleArray(); for (int j = 0; j < getInputFormat().numAttributes(); j++) { if (instance.attribute(j).isNumeric() && (!Utils.isMissingValue(vals[j])) && (getInputFormat().classIndex() != j)) { if (Double.isNaN(m_MinArray[j]) || (m_MaxArray[j] == m_MinArray[j])) { vals[j] = 0;
if (instance.attribute(j).isNumeric() && (!Utils.isMissingValue(vals[j])) && (getInputFormat().classIndex() != j)) { if (Double.isNaN(m_MinArray[j]) || (m_MaxArray[j] == m_MinArray[j])) { value = 0; } else { double[] vals = instance.toDoubleArray(); for (int j = 0; j < getInputFormat().numAttributes(); j++) { if (instance.attribute(j).isNumeric() && (!Utils.isMissingValue(vals[j])) && (getInputFormat().classIndex() != j)) { if (Double.isNaN(m_MinArray[j]) || (m_MaxArray[j] == m_MinArray[j])) { vals[j] = 0;
if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); Instances input = getInputFormat();
if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); Instances input = getInputFormat();