/** * processes the given instance (may change the provided instance) and * returns the modified version. * * @param instance the instance to process * @return the modified data * @throws Exception in case the processing goes wrong */ protected Instance process(Instance instance) throws Exception { m_Reorder.input(instance); m_Reorder.batchFinished(); return m_Reorder.output(); }
/** * processes the given instance (may change the provided instance) and * returns the modified version. * * @param instance the instance to process * @return the modified data * @throws Exception in case the processing goes wrong */ protected Instance process(Instance instance) throws Exception { m_Reorder.input(instance); m_Reorder.batchFinished(); return m_Reorder.output(); }
/** * processes the given instance (may change the provided instance) and * returns the modified version. * * @param instance the instance to process * @return the modified data * @throws Exception in case the processing goes wrong */ @Override protected Instance process(Instance instance) throws Exception { m_Reorder.input(instance); m_Reorder.batchFinished(); return m_Reorder.output(); }
/** * Computes an array that has a value for each element in the partition. (If * the base classifier supports this.) */ public double[] getMembershipValues(Instance inst) throws Exception { if (m_Classifier instanceof PartitionGenerator) { if (m_ReorderOriginal != null) { m_ReorderOriginal.input(inst); inst = m_ReorderOriginal.output(); } Instance newInstance = filterInstance(inst); if (newInstance == null) { double[] unclassified = new double[numElements()]; for (int i = 0; i < unclassified.length; i++) { unclassified[i] = Utils.missingValue(); } return unclassified; } else { if (m_ReorderFiltered != null) { m_ReorderFiltered.input(newInstance); newInstance = m_ReorderFiltered.output(); } return ((PartitionGenerator) m_Classifier).getMembershipValues(newInstance); } } else throw new Exception( "Classifier: " + getClassifierSpec() + " cannot generate a partition"); }
/** * Computes an array that has a value for each element in the partition. (If * the base classifier supports this.) */ public double[] getMembershipValues(Instance inst) throws Exception { if (m_Classifier instanceof PartitionGenerator) { if (m_ReorderOriginal != null) { m_ReorderOriginal.input(inst); inst = m_ReorderOriginal.output(); } Instance newInstance = filterInstance(inst); if (newInstance == null) { double[] unclassified = new double[numElements()]; for (int i = 0; i < unclassified.length; i++) { unclassified[i] = Utils.missingValue(); } return unclassified; } else { if (m_ReorderFiltered != null) { m_ReorderFiltered.input(newInstance); newInstance = m_ReorderFiltered.output(); } return ((PartitionGenerator) m_Classifier).getMembershipValues(newInstance); } } else throw new Exception( "Classifier: " + getClassifierSpec() + " cannot generate a partition"); }