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

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

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

Filter.setInputFormat介绍

[英]Sets the format of the input instances. If the filter is able to determine the output format before seeing any input instances, it does so here. This default implementation clears the output format and output queue, and the new batch flag is set. Overriders should call super.setInputFormat(Instances)
[中]设置输入实例的格式。如果过滤器能够在看到任何输入实例之前确定输出格式,那么它将在此处执行此操作。此默认实现清除输出格式和输出队列,并设置新的批标记。重写器应调用super.setInputFormat(Instances)

代码示例

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true if the outputFormat may be collected immediately
 * @throws Exception if the inputFormat can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 return false;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true if the outputFormat may be collected immediately
 * @throws Exception if the inputFormat can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 m_removeFilter = null;
 return false;
}

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

@Override
public boolean setInputFormat(Instances insts) throws Exception {
 if (m_isReset) {
  m_isReset = false;
  return getBaseFilter().setInputFormat(insts);
 }
 return true;
}

代码示例来源:origin: com.entopix/maui

/**
 * Sets the format of the input instances.
 *
 * @param instanceInfo an Instances object containing the input instance
 * structure (any instances contained in the object are ignored - only the
 * structure is required).
 * @return true if the outputFormat may be collected immediately
 */
public boolean setInputFormat(Instances instanceInfo) throws Exception {
  super.setInputFormat(instanceInfo);
  setOutputFormat(instanceInfo);
  return true;
}

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

/**
 * Sets the format of the input instances.
 *
 * @param instanceInfo an Instances object containing the input instance
 * structure (any instances contained in the object are ignored - only the
 * structure is required).
 * @return true if the outputFormat may be collected immediately
 * @throws Exception if format cannot be processed
 */
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 *
 * @param instanceInfo     an Instances object containing the input 
 *                 instance structure (any instances contained in 
 *                 the object are ignored - only the structure is required).
 * @return             true if the outputFormat may be collected immediately
 * @throws Exception         if the input format can't be set successfully
 */
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 super.setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true if the outputFormat may be collected immediately
 * @throws Exception if the input format can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 *
 * @param instanceInfo     an Instances object containing the input 
 *                 instance structure (any instances contained 
 *                 in the object are ignored - only the structure 
 *                 is required).
 * @return true         if the outputFormat may be collected immediately
 * @throws Exception         if something goes wrong
 */
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true because outputFormat can be collected immediately
 * @throws Exception if the input format can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true because outputFormat can be collected immediately
 * @throws Exception if the input format can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true if the outputFormat may be collected immediately
 * @throws Exception if the input format can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true because outputFormat can be collected immediately
 * @throws Exception if the input format can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat(instanceInfo);
 return true;
}

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

/**
 * Sets the format of the input instances.
 * 
 * @param instanceInfo an Instances object containing the input instance
 *          structure (any instances contained in the object are ignored -
 *          only the structure is required).
 * @return true if the outputFormat may be collected immediately
 * @throws Exception if the input format can't be set successfully
 */
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
 super.setInputFormat(instanceInfo);
 setOutputFormat();
 return true;
}

代码示例来源:origin: com.entopix/maui

/**
 * Sets the format of the input instances.
 *
 * @param instanceInfo an Instances object containing the input instance
 * structure (any instances contained in the object are ignored - only the
 * structure is required).
 * @return true if the outputFormat may be collected immediately
 */
public boolean setInputFormat(Instances instanceInfo) throws Exception {
  super.setInputFormat(instanceInfo);
  setOutputFormat(instanceInfo);
  m_SelectCols.setUpper(instanceInfo.numAttributes() - 1);
  return true;
}

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

/** test string attribute */
public void testString() {
 Instances icopy = new Instances(m_Instances);
 try {
  ((RemoveFrequentValues) m_Filter).setAttributeIndex(Integer.toString(indexString + 1));
  m_Filter.setInputFormat(icopy);
  fail("Should have thrown an exception selecting on a STRING attribute!");
 } catch (Exception ex) {
  // OK
 }
}

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

/** test numeric attribute */
public void testNumeric() {
 Instances icopy = new Instances(m_Instances);
 try {
  ((RemoveFrequentValues) m_Filter).setAttributeIndex(Integer.toString(indexNumeric + 1));
  m_Filter.setInputFormat(icopy);
  fail("Should have thrown an exception selecting on a NUMERIC attribute!");
 } catch (Exception ex) {
  // OK
 }
}

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

/** test numeric attribute */
public void testNumeric() {
 Instances icopy = new Instances(m_Instances);
 try {
  ((RemoveFrequentValues) m_Filter).setAttributeIndex(Integer.toString(indexNumeric + 1));
  m_Filter.setInputFormat(icopy);
  fail("Should have thrown an exception selecting on a NUMERIC attribute!");
 } catch (Exception ex) {
  // OK
 }
}

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

/** test string attribute */
public void testString() {
 Instances icopy = new Instances(m_Instances);
 try {
  ((RemoveFrequentValues) m_Filter).setAttributeIndex(Integer.toString(indexString + 1));
  m_Filter.setInputFormat(icopy);
  fail("Should have thrown an exception selecting on a STRING attribute!");
 } catch (Exception ex) {
  // OK
 }
}

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

public void testString() {
 Instances icopy = new Instances(m_Instances);
 try {
  ((RemoveWithValues)m_Filter).setAttributeIndex("1");
  m_Filter.setInputFormat(icopy);
  fail("Should have thrown an exception selecting on a STRING attribute!");
 } catch (Exception ex) {
  // OK
 }
}

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

public void testString() {
 Instances icopy = new Instances(m_Instances);
 try {
  ((RemoveWithValues)m_Filter).setAttributeIndex("1");
  m_Filter.setInputFormat(icopy);
  fail("Should have thrown an exception selecting on a STRING attribute!");
 } catch (Exception ex) {
  // OK
 }
}

相关文章