gpt4 book ai didi

weka.core.WekaException.()方法的使用及代码示例

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

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

WekaException.<init>介绍

[英]Creates a new WekaException with no message.
[中]创建没有消息的新WekaException。

代码示例

代码示例来源: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

@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

@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: 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

@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());
 }
}

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

@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: nz.ac.waikato.cms.weka/weka-stable

/**
 * Try to get a driver from Weka package classloaders
 *
 * @param driverClass the name of the driver class to try and instantiate
 * @return the instantiated driver class
 * @throws Exception if a problem occurs
 */
protected Driver getDriver(String driverClass) throws Exception {
 Object result = WekaPackageClassLoaderManager.objectForName(driverClass);
 if (!(result instanceof Driver)) {
  throw new WekaException("JDBC driver " + driverClass
   + " does not implement java.sql.Driver");
 }
 return (Driver) result;
}

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

/**
 * Try to get a driver from Weka package classloaders
 *
 * @param driverClass the name of the driver class to try and instantiate
 * @return the instantiated driver class
 * @throws Exception if a problem occurs
 */
protected Driver getDriver(String driverClass) throws Exception {
 Object result = WekaPackageClassLoaderManager.objectForName(driverClass);
 if (!(result instanceof Driver)) {
  throw new WekaException("JDBC driver " + driverClass
   + " does not implement java.sql.Driver");
 }
 return (Driver) result;
}

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

/**
 * Serializes the supplied flow to JSON and writes it out to the supplied file
 *
 * @param flow the {@code Flow} to serialize
 * @param file the {@code File} to write to
 * @throws WekaException if a problem occurs
 */
public static void writeFlow(Flow flow, File file) throws WekaException {
 try {
  Writer w = new BufferedWriter(new FileWriter(file));
  writeFlow(flow, w);
 } catch (IOException ex) {
  throw new WekaException(ex);
 }
}

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

/**
 * Initialize the step.
 *
 * @throws WekaException if a problem occurs during initialization
 */
@Override
public void stepInit() throws WekaException {
 m_classIsSet = true;
 m_classIsNominal = true;
 m_classValue = getStepManager().environmentSubstitute(m_classValueS).trim();
 if (m_classValue.length() == 0) {
  throw new WekaException("No class label specified as the positive class!");
 }
}

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

/**
 * Initialize the step prior to execution
 *
 * @throws WekaException if a problem occurs
 */
@Override
public void stepInit() throws WekaException {
 if (m_classColumnS == null || m_classColumnS.length() == 0) {
  throw new WekaException("No class column specified!");
 }
 m_classCol = getStepManager().environmentSubstitute(m_classColumnS).trim();
 m_classAssigned = false;
 m_isInstanceStream = false;
 m_streamCount = 0;
}

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

/**
 * Initialize the step.
 *
 * @throws WekaException if a problem occurs during initialization
 */
@Override
public void stepInit() throws WekaException {
 m_classIsSet = true;
 m_classIsNominal = true;
 m_classValue = getStepManager().environmentSubstitute(m_classValueS).trim();
 if (m_classValue.length() == 0) {
  throw new WekaException("No class label specified as the positive class!");
 }
}

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

@Override
public void stepInit() throws WekaException {
 m_isReset = true;
 m_PlotInstances = null;
 m_aggregatedPlotInstances = null;
 m_taskCount = new AtomicInteger(0);
 if (m_costSensitiveEval && m_costString != null
  && m_costString.length() > 0) {
  try {
   m_matrix = CostMatrix.parseMatlab(getCostMatrixString());
  } catch (Exception e) {
   throw new WekaException(e);
  }
 }
}

代码示例来源:origin: dnmilne/wikipediaminer

public HashMap<Integer,Double> getTopicWeights(Collection<Topic> topics) throws Exception {
  
  if (!decider.isReady()) 
    throw new WekaException("You must build (or load) classifier first.") ;
  
  HashMap<Integer, Double> topicWeights = new HashMap<Integer, Double>() ;

  for (Topic topic: topics) {
  
    Instance i = getInstance(topic, null) ;
    
    double prob = decider.getDecisionDistribution(i).get(true) ;
    topicWeights.put(topic.getId(), prob) ;
    
    candidatesConsidered++ ;
  }
  
  return topicWeights ;
}

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

/**
 * Returns a reference to the step being managed if it has one or more
 * outgoing CON_INFO connections.
 * 
 * @return the step being managed if outgoing CON_INFO connections are present
 * @throws WekaException if there are no outgoing CON_INFO connections
 */
@Override
public Step getInfoStep() throws WekaException {
 if (numOutgoingConnectionsOfType(StepManager.CON_INFO) > 0) {
  return getManagedStep();
 }
 throw new WekaException("There are no outgoing info connections from "
  + "this step!");
}

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

/**
 * Execute the flow
 *
 * @throws WekaException if a problem occurs
 */
public void run() throws WekaException {
 if (m_flow == null) {
  throw new WekaException("No flow to execute!");
 }
 if (m_startSequentially) {
  runSequentially();
 } else {
  runParallel();
 }
}

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

/**
 * Execute the flow
 *
 * @throws WekaException if a problem occurs
 */
public void run() throws WekaException {
 if (m_flow == null) {
  throw new WekaException("No flow to execute!");
 }
 if (m_startSequentially) {
  runSequentially();
 } else {
  runParallel();
 }
}

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

protected void initDataGenerator(Instances trainingData) throws WekaException {
 boolean[] attsToWeightOn;
 // build DataGenerator
 attsToWeightOn = new boolean[trainingData.numAttributes()];
 attsToWeightOn[m_xAttribute] = true;
 attsToWeightOn[m_yAttribute] = true;
 m_dataGenerator = new KDDataGenerator();
 m_dataGenerator.setWeightingDimensions(attsToWeightOn);
 m_dataGenerator.setKernelBandwidth(m_kernelBandwidth);
 try {
  m_dataGenerator.buildGenerator(trainingData);
 } catch (Exception ex) {
  throw new WekaException(ex);
 }
}

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

protected void initDataGenerator(Instances trainingData) throws WekaException {
 boolean[] attsToWeightOn;
 // build DataGenerator
 attsToWeightOn = new boolean[trainingData.numAttributes()];
 attsToWeightOn[m_xAttribute] = true;
 attsToWeightOn[m_yAttribute] = true;
 m_dataGenerator = new KDDataGenerator();
 m_dataGenerator.setWeightingDimensions(attsToWeightOn);
 m_dataGenerator.setKernelBandwidth(m_kernelBandwidth);
 try {
  m_dataGenerator.buildGenerator(trainingData);
 } catch (Exception ex) {
  throw new WekaException(ex);
 }
}

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