本文整理汇总了Java中weka.core.Capabilities.test方法的典型用法代码示例。如果您正苦于以下问题:Java Capabilities.test方法的具体用法?Java Capabilities.test怎么用?Java Capabilities.test使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weka.core.Capabilities
的用法示例。
在下文中一共展示了Capabilities.test方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setInstances
import weka.core.Capabilities; //导入方法依赖的package包/类
/**
* Sets instances that should be stored.
*
* @param instances the instances
*/
@Override
public void setInstances(Instances instances) {
Capabilities cap = getCapabilities();
if (!cap.test(instances)) {
throw new IllegalArgumentException(cap.getFailReason());
}
if (m_retrieval == INCREMENTAL) {
if (setStructure(instances) == CANCEL) {
cancel();
}
} else {
m_instances = instances;
}
}
示例2: setStructure
import weka.core.Capabilities; //导入方法依赖的package包/类
/**
* Sets the strcuture of the instances for the first step of incremental
* saving. The instances only need to have a header.
*
* @param headerInfo an instances object.
* @return the appropriate write mode
*/
public int setStructure(Instances headerInfo) {
Capabilities cap = getCapabilities();
if (!cap.test(headerInfo)) {
throw new IllegalArgumentException(cap.getFailReason());
}
if (m_writeMode == WAIT && headerInfo != null) {
m_instances = headerInfo;
m_writeMode = STRUCTURE_READY;
} else {
if ((headerInfo == null) || !(m_writeMode == STRUCTURE_READY)
|| !headerInfo.equalHeaders(m_instances)) {
m_instances = null;
if (m_writeMode != WAIT) {
System.err
.println("A structure cannot be set up during an active incremental saving process.");
}
m_writeMode = CANCEL;
}
}
return m_writeMode;
}