当前位置: 首页>>代码示例>>Java>>正文


Java Capability.NO_CLASS属性代码示例

本文整理汇总了Java中weka.core.Capabilities.Capability.NO_CLASS属性的典型用法代码示例。如果您正苦于以下问题:Java Capability.NO_CLASS属性的具体用法?Java Capability.NO_CLASS怎么用?Java Capability.NO_CLASS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在weka.core.Capabilities.Capability的用法示例。


在下文中一共展示了Capability.NO_CLASS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCapabilities

/**
 * Returns the Capabilities of this filter, customized based on the data.
 * I.e., if removes all class capabilities, in case there's not class
 * attribute present or removes the NO_CLASS capability, in case that there's
 * a class present.
 *
 * @param data the data to use for customization
 * @return the capabilities of this object, based on the data
 * @see #getCapabilities()
 */
public Capabilities getCapabilities(Instances data) {
  Capabilities result;
  Capabilities classes;
  Iterator<Capability> iter;
  Capability cap;

  result = getCapabilities();

  // no class? -> remove all class capabilites apart from NO_CLASS
  if (data.classIndex() == -1) {
    classes = result.getClassCapabilities();
    iter = classes.capabilities();
    while (iter.hasNext()) {
      cap = iter.next();
      if (cap != Capability.NO_CLASS) {
        result.disable(cap);
        result.disableDependency(cap);
      }
    }
  }
  // class? -> remove NO_CLASS
  else {
    result.disable(Capability.NO_CLASS);
    result.disableDependency(Capability.NO_CLASS);
  }

  return result;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:38,代码来源:Filter.java


注:本文中的weka.core.Capabilities.Capability.NO_CLASS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。