gpt4 book ai didi

weka.core.WekaException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 05:41:05 26 4
gpt4 key购买 nike

本文整理了Java中weka.core.WekaException类的一些代码示例,展示了WekaException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WekaException类的具体详情如下:
包路径:weka.core.WekaException
类名称:WekaException

WekaException介绍

[英]Class for Weka-specific exceptions.
[中]类,用于特定于Weka的异常。

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Initialize the step
 *
 * @throws WekaException if the data to output has not been set yet
 */
@Override
public void stepInit() throws WekaException {
 if (m_instances == null) {
  throw new WekaException(
   "Has not been initialized with a set of instances");
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Constructor with message and cause
 * 
 * @param message the message for the exception
 * @param cause the root cause Throwable
 */
public WekaException(String message, Throwable cause) {
 this(message);
 initCause(cause);
 fillInStackTrace();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Get an ID string for this flow. The ID is made up of the FlowName + "_" +
 * the hashcode generated from the JSON representation of the flow.
 * 
 * @return
 */
public String getFlowID() {
 String ID = getFlowName();
 try {
  ID += "_" + toJSON().hashCode();
 } catch (WekaException ex) {
  ex.printStackTrace();
 }
 return ID;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

throw new WekaException("Incorrect type of algorithm");
 new WekaException(
  "Can't have both instance and batch-based incomming connections!");
cause.fillInStackTrace();
getStepManager().logError(cause.getMessage(), cause);
throw new WekaException(cause);

代码示例来源:origin: Waikato/weka-trunk

/**
 * Initialize the step being managed
 *
 * @return true if the initialization was successful
 */
protected boolean initStep() {
 boolean initializedOK = false;
 m_stepIsBusy = false;
 m_stopRequested = false;
 m_stepIsFinished = false;
 try {
  getManagedStep().stepInit();
  // getManagedStep().init();
  initializedOK = true;
 } catch (WekaException ex) {
  logError(ex.getMessage(), ex);
 } catch (Throwable ex) {
  logError(ex.getMessage(), ex);
 }
 m_throughput = null;
 return initializedOK;
}

代码示例来源:origin: Waikato/weka-trunk

throw new WekaException("Incorrect type of algorithm");
 new WekaException(
  "Can't have both instance and batch-based incomming connections!");
cause.fillInStackTrace();
getStepManager().logError(cause.getMessage(), cause);
throw new WekaException(cause);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Initialize the step being managed
 *
 * @return true if the initialization was successful
 */
protected boolean initStep() {
 boolean initializedOK = false;
 m_stepIsBusy = false;
 m_stopRequested = false;
 m_stepIsFinished = false;
 try {
  getManagedStep().stepInit();
  // getManagedStep().init();
  initializedOK = true;
 } catch (WekaException ex) {
  logError(ex.getMessage(), ex);
 } catch (Throwable ex) {
  logError(ex.getMessage(), ex);
 }
 m_throughput = null;
 return initializedOK;
}

代码示例来源:origin: Waikato/weka-trunk

@SuppressWarnings("unchecked")
 @Override
 public void restoreData(Object data) throws WekaException {
  if (!(data instanceof List)) {
   throw new WekaException("Was expecting an instance of a List");
  }

  m_data = ((List<Data>) data);
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Constructor with message and cause
 * 
 * @param message the message for the exception
 * @param cause the root cause Throwable
 */
public WekaException(String message, Throwable cause) {
 this(message);
 initCause(cause);
 fillInStackTrace();
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Start the managed step processing
 */
protected void startStep() {
 try {
  getManagedStep().start();
 } catch (WekaException ex) {
  interrupted();
  logError(ex.getMessage(), ex);
 } catch (Throwable ex) {
  interrupted();
  logError(ex.getMessage(), ex);
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Get an ID string for this flow. The ID is made up of the FlowName + "_" +
 * the hashcode generated from the JSON representation of the flow.
 * 
 * @return
 */
public String getFlowID() {
 String ID = getFlowName();
 try {
  ID += "_" + toJSON().hashCode();
 } catch (WekaException ex) {
  ex.printStackTrace();
 }
 return ID;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@SuppressWarnings("unchecked")
 @Override
 public void restoreData(Object data) throws WekaException {
  if (!(data instanceof List)) {
   throw new WekaException("Was expecting an instance of a List");
  }

  m_data = ((List<Data>) data);
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Start the managed step processing
 */
protected void startStep() {
 try {
  getManagedStep().start();
 } catch (WekaException ex) {
  interrupted();
  logError(ex.getMessage(), ex);
 } catch (Throwable ex) {
  interrupted();
  logError(ex.getMessage(), ex);
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Initialize the step
 *
 * @throws WekaException if the data to output has not been set yet
 */
@Override
public void stepInit() throws WekaException {
 if (m_instances == null) {
  throw new WekaException(
   "Has not been initialized with a set of instances");
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Have the managed step process the supplied data object
 *
 * @param data the data for the managed step to process
 */
protected void processIncoming(Data data) {
 try {
  getManagedStep().processIncoming(data);
 } catch (WekaException ex) {
  interrupted();
  logError(ex.getMessage(), ex);
 } catch (Throwable e) {
  interrupted();
  logError(e.getMessage(), e);
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Restore the data (plots) for this step
 *
 * @param data the data to set
 * @throws WekaException if a problem occurs
 */
@SuppressWarnings("unchecked")
@Override
public void restoreData(Object data) throws WekaException {
 if (!(data instanceof Object[])) {
  throw new WekaException("Argument must be a three element array, "
   + "where the first element holds a list of Plot2D objects, the "
   + "second a list of Instances objects and the third "
   + "a boolean - true if the data is threshold data");
 }
 m_plots = ((List<PlotData2D>) ((Object[]) data)[0]);
 // m_offscreenPlotData = ((List<Instances>) ((Object[]) data)[1]);
 m_dataIsThresholdData = ((Boolean) ((Object[]) data)[1]);
 m_offscreenPlotData = new ArrayList<Instances>();
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Have the managed step process the supplied data object
 *
 * @param data the data for the managed step to process
 */
protected void processIncoming(Data data) {
 try {
  getManagedStep().processIncoming(data);
 } catch (WekaException ex) {
  interrupted();
  logError(ex.getMessage(), ex);
 } catch (Throwable e) {
  interrupted();
  logError(e.getMessage(), e);
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Restore the data (plots) for this step
 *
 * @param data the data to set
 * @throws WekaException if a problem occurs
 */
@SuppressWarnings("unchecked")
@Override
public void restoreData(Object data) throws WekaException {
 if (!(data instanceof Object[])) {
  throw new WekaException("Argument must be a three element array, "
   + "where the first element holds a list of Plot2D objects, the "
   + "second a list of Instances objects and the third "
   + "a boolean - true if the data is threshold data");
 }
 m_plots = ((List<PlotData2D>) ((Object[]) data)[0]);
 // m_offscreenPlotData = ((List<Instances>) ((Object[]) data)[1]);
 m_dataIsThresholdData = ((Boolean) ((Object[]) data)[1]);
 m_offscreenPlotData = new ArrayList<Instances>();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@SuppressWarnings("unchecked")
@Override
public void restoreData(Object data) throws WekaException {
 if (!(data instanceof List)) {
  throw new WekaException("Argument must be a List<PlotData2D>");
 }
 m_plots = (List<PlotData2D>) data;
 // need to generate the outgoing Image data...
 for (PlotData2D pd : m_plots) {
  createOffscreenPlot(pd);
 }
}

代码示例来源:origin: Waikato/wekaDeeplearning4j

@Override
protected Instances determineOutputFormat(Instances inputFormat) throws Exception {
 try(ObjectInputStream ois = new ObjectInputStream(new FileInputStream(modelFile))){
  model = (Dl4jMlpClassifier) ois.readObject();
  return model.getActivationsAtLayer(transformationLayerName, inputFormat);
 } catch (IOException e) {
  throw new WekaException("Could not read model file: " + modelFile.getAbsolutePath());
 }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com