weka.filters.unsupervised.attribute.Add.getInputFormat()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(107)

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

Add.getInputFormat介绍

暂无

代码示例

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

/**
 * Input an instance for filtering. Ordinarily the instance is processed and
 * made available for output immediately. Some filters require all instances
 * be read before producing output.
 * 
 * @param instance the input instance
 * @return true if the filtered instance may now be collected with output().
 * @throws IllegalStateException if no input format has been defined.
 */
@Override
public boolean input(Instance instance) {
 if (getInputFormat() == null) {
  throw new IllegalStateException("No input instance format defined");
 }
 if (m_NewBatch) {
  resetQueue();
  m_NewBatch = false;
 }
 Instance inst = (Instance) instance.copy();
 // First copy string values from input to output
 copyValues(inst, true, inst.dataset(), outputFormatPeek());
 // Insert the new attribute and reassign to output
 inst.setDataset(null);
 inst.insertAttributeAt(m_Insert.getIndex());
 push(inst); // No need to copy instance
 return true;
}

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

if (getInputFormat() != null) {
 setInputFormat(getInputFormat());

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

/**
 * Input an instance for filtering. Ordinarily the instance is processed and
 * made available for output immediately. Some filters require all instances
 * be read before producing output.
 * 
 * @param instance the input instance
 * @return true if the filtered instance may now be collected with output().
 * @throws IllegalStateException if no input format has been defined.
 */
@Override
public boolean input(Instance instance) {
 if (getInputFormat() == null) {
  throw new IllegalStateException("No input instance format defined");
 }
 if (m_NewBatch) {
  resetQueue();
  m_NewBatch = false;
 }
 Instance inst = (Instance) instance.copy();
 // First copy string values from input to output
 copyValues(inst, true, inst.dataset(), outputFormatPeek());
 // Insert the new attribute and reassign to output
 inst.setDataset(null);
 inst.insertAttributeAt(m_Insert.getIndex());
 push(inst); // No need to copy instance
 return true;
}

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

if (getInputFormat() != null) {
 setInputFormat(getInputFormat());

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

|| (m_Insert.getIndex() > getInputFormat().numAttributes())) {
throw new IllegalArgumentException("Index out of range");

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

|| (m_Insert.getIndex() > getInputFormat().numAttributes())) {
throw new IllegalArgumentException("Index out of range");

相关文章