/** * Accepts results from a ResultProducer. * * @param rp the ResultProducer that generated the results * @param key an array of Objects (Strings or Doubles) that uniquely identify * a result for a given ResultProducer with given compatibilityState * @param result the results stored in an array. The objects stored in the * array may be Strings, Doubles, or null (for the missing value). * @throws Exception if the result could not be accepted. */ @Override public void acceptResult(ResultProducer rp, Object[] key, Object[] result) throws Exception { if (m_ResultProducer != rp) { throw new Error("Unrecognized ResultProducer sending results!!"); } // Add in current step as key field Object[] newKey = new Object[key.length + 1]; System.arraycopy(key, 0, newKey, 0, key.length); newKey[key.length] = new String("" + m_CurrentSize); // Pass on to result listener m_ResultListener.acceptResult(this, newKey, result); }
/** * Determines whether the results for a specified key must be generated. * * @param rp the ResultProducer wanting to generate the results * @param key an array of Objects (Strings or Doubles) that uniquely identify * a result for a given ResultProducer with given compatibilityState * @return true if the result should be generated * @throws Exception if it could not be determined if the result is needed. */ @Override public boolean isResultRequired(ResultProducer rp, Object[] key) throws Exception { if (m_ResultProducer != rp) { throw new Error("Unrecognized ResultProducer sending results!!"); } // Add in current step as key field Object[] newKey = new Object[key.length + 1]; System.arraycopy(key, 0, newKey, 0, key.length); newKey[key.length] = new String("" + m_CurrentSize); // Pass on request to result listener return m_ResultListener.isResultRequired(this, newKey); }
/** * When this method is called, it indicates that no more results will be sent * that need to be grouped together in any way. * * @param rp the ResultProducer that generated the results * @throws Exception if an error occurs */ @Override public void postProcess(ResultProducer rp) throws Exception { m_ResultListener.postProcess(this); }
boolean isRequiredByListener = m_ResultListener.isResultRequired(this, key); m_ResultListener.acceptResult(this, key, result);
/** * Prepare for the results to be received. * * @param rp the ResultProducer that will generate the results * @throws Exception if an error occurs during preprocessing. */ @Override public void preProcess(ResultProducer rp) throws Exception { if (m_ResultListener == null) { throw new Exception("No ResultListener set"); } m_ResultListener.preProcess(this); }
.determineColumnConstraints(m_ResultProducer);
boolean isRequiredByListener = m_ResultListener.isResultRequired(this, key); m_ResultListener.acceptResult(this, key, result);
/** * Prepare for the results to be received. * * @param rp the ResultProducer that will generate the results * @throws Exception if an error occurs during preprocessing. */ @Override public void preProcess(ResultProducer rp) throws Exception { if (m_ResultListener == null) { throw new Exception("No ResultListener set"); } m_ResultListener.preProcess(this); }
.determineColumnConstraints(m_ResultProducer);
/** * Gets the keys for a specified run number. Different run numbers correspond * to different randomizations of the data. Keys produced should be sent to * the current ResultListener * * @param run the run number to get keys for. * @throws Exception if a problem occurs while getting the keys */ @Override public void doRunKeys(int run) throws Exception { if (m_Instances == null) { throw new Exception("No Instances set"); } // Add in some fields to the key like run number, dataset name Object[] seKey = m_SplitEvaluator.getKey(); Object[] key = new Object[seKey.length + 2]; key[0] = Utils.backQuoteChars(m_Instances.relationName()); key[1] = "" + run; System.arraycopy(seKey, 0, key, 2, seKey.length); if (m_ResultListener.isResultRequired(this, key)) { try { m_ResultListener.acceptResult(this, key, null); } catch (Exception ex) { // Save the train and test datasets for debugging purposes? throw ex; } } }
/** * When this method is called, it indicates that no more results will be sent * that need to be grouped together in any way. * * @param rp the ResultProducer that generated the results * @throws Exception if an error occurs */ @Override public void postProcess(ResultProducer rp) throws Exception { m_ResultListener.postProcess(this); }
/** * Prepare for the results to be received. * * @param rp the ResultProducer that will generate the results * @throws Exception if an error occurs during preprocessing. */ @Override public void preProcess(ResultProducer rp) throws Exception { if (m_ResultListener == null) { throw new Exception("No ResultListener set"); } m_ResultListener.preProcess(this); }
/** * Accepts results from a ResultProducer. * * @param rp the ResultProducer that generated the results * @param key an array of Objects (Strings or Doubles) that uniquely identify * a result for a given ResultProducer with given compatibilityState * @param result the results stored in an array. The objects stored in the * array may be Strings, Doubles, or null (for the missing value). * @throws Exception if the result could not be accepted. */ @Override public void acceptResult(ResultProducer rp, Object[] key, Object[] result) throws Exception { if (m_ResultProducer != rp) { throw new Error("Unrecognized ResultProducer sending results!!"); } // Add in current step as key field Object[] newKey = new Object[key.length + 1]; System.arraycopy(key, 0, newKey, 0, key.length); newKey[key.length] = new String("" + m_CurrentSize); // Pass on to result listener m_ResultListener.acceptResult(this, newKey, result); }
/** * Determines whether the results for a specified key must be generated. * * @param rp the ResultProducer wanting to generate the results * @param key an array of Objects (Strings or Doubles) that uniquely identify * a result for a given ResultProducer with given compatibilityState * @return true if the result should be generated * @throws Exception if it could not be determined if the result is needed. */ @Override public boolean isResultRequired(ResultProducer rp, Object[] key) throws Exception { if (m_ResultProducer != rp) { throw new Error("Unrecognized ResultProducer sending results!!"); } // Add in current step as key field Object[] newKey = new Object[key.length + 1]; System.arraycopy(key, 0, newKey, 0, key.length); newKey[key.length] = new String("" + m_CurrentSize); // Pass on request to result listener return m_ResultListener.isResultRequired(this, newKey); }
/** * Gets the keys for a specified run number. Different run numbers correspond * to different randomizations of the data. Keys produced should be sent to * the current ResultListener * * @param run the run number to get keys for. * @throws Exception if a problem occurs while getting the keys */ @Override public void doRunKeys(int run) throws Exception { if (m_Instances == null) { throw new Exception("No Instances set"); } // Add in some fields to the key like run number, dataset name Object[] seKey = m_SplitEvaluator.getKey(); Object[] key = new Object[seKey.length + 2]; key[0] = Utils.backQuoteChars(m_Instances.relationName()); key[1] = "" + run; System.arraycopy(seKey, 0, key, 2, seKey.length); if (m_ResultListener.isResultRequired(this, key)) { try { m_ResultListener.acceptResult(this, key, null); } catch (Exception ex) { // Save the train and test datasets for debugging purposes? throw ex; } } }
/** * When this method is called, it indicates that no more results will be sent * that need to be grouped together in any way. * * @param rp the ResultProducer that generated the results * @throws Exception if an error occurs */ @Override public void postProcess(ResultProducer rp) throws Exception { m_ResultListener.postProcess(this); }
/** * Prepare for the results to be received. * * @param rp the ResultProducer that will generate the results * @throws Exception if an error occurs during preprocessing. */ @Override public void preProcess(ResultProducer rp) throws Exception { if (m_ResultListener == null) { throw new Exception("No ResultListener set"); } m_ResultListener.preProcess(this); }
/** * Gets the keys for a specified run number. Different run numbers correspond * to different randomizations of the data. Keys produced should be sent to * the current ResultListener * * @param run the run number to get keys for. * @throws Exception if a problem occurs while getting the keys */ @Override public void doRunKeys(int run) throws Exception { // Generate the template Object[] template = determineTemplate(run); String[] newKey = new String[template.length - 1]; System.arraycopy(template, 0, newKey, 0, m_KeyIndex); System.arraycopy(template, m_KeyIndex + 1, newKey, m_KeyIndex, template.length - m_KeyIndex - 1); m_ResultListener.acceptResult(this, newKey, null); }
template.length - m_KeyIndex - 1); if (m_ResultListener.isResultRequired(this, newKey)) {
/** * Gets the keys for a specified run number. Different run numbers correspond * to different randomizations of the data. Keys produced should be sent to * the current ResultListener * * @param run the run number to get keys for. * @throws Exception if a problem occurs while getting the keys */ @Override public void doRunKeys(int run) throws Exception { if (m_Instances == null) { throw new Exception("No Instances set"); } // Add in some fields to the key like run number, dataset name Object[] seKey = m_SplitEvaluator.getKey(); Object[] key = new Object[seKey.length + 2]; key[0] = Utils.backQuoteChars(m_Instances.relationName()); key[1] = "" + run; System.arraycopy(seKey, 0, key, 2, seKey.length); if (m_ResultListener.isResultRequired(this, key)) { try { m_ResultListener.acceptResult(this, key, null); } catch (Exception ex) { // Save the train and test datasets for debugging purposes? throw ex; } } }