weka.filters.Filter.copyValues()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(84)

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

Filter.copyValues介绍

[英]Copies string/relational values contained in the instance copied to a new dataset. The Instance must already be assigned to a dataset. This dataset and the destination dataset must have the same structure.
[中]将实例中包含的字符串/关系值复制到新数据集。实例必须已分配给数据集。此数据集和目标数据集必须具有相同的结构。

代码示例

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

/**
 * Adds the supplied input instance to the inputformat dataset for later
 * processing. Use this method rather than getInputFormat().add(instance). Or
 * else. Note that the provided instance gets copied when buffered.
 *
 * @param instance the <code>Instance</code> to buffer.
 */
protected void bufferInput(Instance instance) {
 if (instance != null) {
  instance = (Instance)instance.copy(); // The copyValues() method *does* modify the instance!
  copyValues(instance, true);
  m_InputFormat.add(instance);
 }
}

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

/**
 * Adds the supplied input instance to the inputformat dataset for later
 * processing. Use this method rather than getInputFormat().add(instance). Or
 * else. Note that the provided instance gets copied when buffered.
 *
 * @param instance the <code>Instance</code> to buffer.
 */
protected void bufferInput(Instance instance) {
 if (instance != null) {
  instance = (Instance)instance.copy(); // The copyValues() method *does* modify the instance!
  copyValues(instance, true);
  m_InputFormat.add(instance);
 }
}

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

/**
 * Adds an output instance to the queue. The derived class should use this
 * method for each output instance it makes available. Note that the instance
 * is only copied before it is added to the output queue if copyInstance has
 * value true and if the instance has a reference to a dataset.
 *
 * @param instance the instance to be added to the queue.
 * @param copyInstance whether instance is to be copied
 */
protected void push(Instance instance, boolean copyInstance) {
 if (instance != null) {
  if (instance.dataset() != null) {
   if (copyInstance) {
    instance = (Instance) instance.copy();
   }
   copyValues(instance, false);
  }
  instance.setDataset(m_OutputFormat);
  m_OutputQueue.push(instance);
 }
}

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

/**
 * Adds an output instance to the queue. The derived class should use this
 * method for each output instance it makes available. Note that the instance
 * is only copied before it is added to the output queue if copyInstance has
 * value true and if the instance has a reference to a dataset.
 *
 * @param instance the instance to be added to the queue.
 * @param copyInstance whether instance is to be copied
 */
protected void push(Instance instance, boolean copyInstance) {
 if (instance != null) {
  if (instance.dataset() != null) {
   if (copyInstance) {
    instance = (Instance) instance.copy();
   }
   copyValues(instance, false);
  }
  instance.setDataset(m_OutputFormat);
  m_OutputQueue.push(instance);
 }
}

相关文章