weka.core.Instances.lastInstance()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(105)

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

Instances.lastInstance介绍

[英]Returns the last instance in the set.
[中]返回集合中的最后一个实例。

代码示例

代码示例来源:origin: com.googlecode.obvious/obviousx-weka

@Override
public Instance lastInstance() {
 return super.lastInstance();
}

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

/**
 * Generate an example of the dataset dataset.
 * 
 * @return the instance generated
 * @throws Exception if format not defined or generating <br/>
 *           examples one by one is not possible, because voting is chosen
 */
@Override
public Instance generateExample() throws Exception {
 Random random = getRandom();
 Instances format = getDatasetFormat();
 if (format == null) {
  throw new Exception("Dataset format not defined.");
 }
 if (getVoteFlag()) {
  throw new Exception("Examples cannot be generated one by one.");
 }
 // generate values for all attributes
 format = generateExamples(1, random, format);
 return format.lastInstance();
}

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

/**
 * Generate an example of the dataset dataset.
 * 
 * @return the instance generated
 * @throws Exception if format not defined or generating <br/>
 *           examples one by one is not possible, because voting is chosen
 */
@Override
public Instance generateExample() throws Exception {
 Random random = getRandom();
 Instances format = getDatasetFormat();
 if (format == null) {
  throw new Exception("Dataset format not defined.");
 }
 if (getVoteFlag()) {
  throw new Exception("Examples cannot be generated one by one.");
 }
 // generate values for all attributes
 format = generateExamples(1, random, format);
 return format.lastInstance();
}

代码示例来源:origin: Waikato/meka

Instance x = D.lastInstance();
D.remove(D.numInstances()-1);
int L = Integer.parseInt(args[1]);

代码示例来源:origin: net.sf.meka/meka

Instance x = D.lastInstance();
D.remove(D.numInstances()-1);
int L = Integer.parseInt(args[1]);

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

if (Utils.gr(weights[j], 0)) {
 instances[j].add(instance);
 instances[j].lastInstance().
  setWeight(weights[j] * instance.weight());

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

if (Utils.gr(weights[j], 0)) {
 instances[j].add(instance);
 instances[j].lastInstance().
  setWeight(weights[j] * instance.weight());

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

Instance inst = newTrain.instance(i);
newTrainTransformed.add(inst);
newTrainTransformed.lastInstance().
setClassValue(m_OldIndexToNewIndex[(int)inst.classValue()]);

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

Instance inst = newTrain.instance(i);
newTrainTransformed.add(inst);
newTrainTransformed.lastInstance().
setClassValue(m_OldIndexToNewIndex[(int)inst.classValue()]);

相关文章

Instances类方法