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

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

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

Instances.initialize介绍

[英]initializes with the header information of the given dataset and sets the capacity of the set of instances.
[中]使用给定数据集的头信息初始化,并设置实例集的容量。

代码示例

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

/**
 * Constructor creating an empty set of instances. Copies references to the
 * header information from the given set of instances. Sets the capacity of
 * the set of instances to 0 if its negative.
 * 
 * @param dataset the instances from which the header information is to be
 *          taken
 * @param capacity the capacity of the new dataset
 */
public Instances(/* @non_null@ */Instances dataset, int capacity) {
 initialize(dataset, capacity);
}

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

/**
 * Constructor creating an empty set of instances. Copies references to the
 * header information from the given set of instances. Sets the capacity of
 * the set of instances to 0 if its negative.
 * 
 * @param dataset the instances from which the header information is to be
 *          taken
 * @param capacity the capacity of the new dataset
 */
public Instances(/* @non_null@ */Instances dataset, int capacity) {
 initialize(dataset, capacity);
}

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

@Override
protected void initialize(Instances dataset, int capacity) {
 super.initialize(dataset, capacity);
}

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

/**
 * Reads the header of an ARFF file from a reader and reserves space for the
 * given number of instances. Lets the class index be undefined (negative).
 * 
 * @param reader the reader
 * @param capacity the capacity
 * @throws IllegalArgumentException if the header is not read successfully or
 *           the capacity is negative.
 * @throws IOException if there is a problem with the reader.
 * @deprecated instead of using this method in conjunction with the
 *             <code>readInstance(Reader)</code> method, one should use the
 *             <code>ArffLoader</code> or <code>DataSource</code> class
 *             instead.
 * @see weka.core.converters.ArffLoader
 * @see weka.core.converters.ConverterUtils.DataSource
 */
// @ requires capacity >= 0;
// @ ensures classIndex() == -1;
@Deprecated
public Instances(/* @non_null@ */Reader reader, int capacity) throws IOException {
 ArffReader arff = new ArffReader(reader, 0);
 Instances header = arff.getStructure();
 initialize(header, capacity);
 m_Lines = arff.getLineNo();
}

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

/**
 * Reads the header of an ARFF file from a reader and reserves space for the
 * given number of instances. Lets the class index be undefined (negative).
 * 
 * @param reader the reader
 * @param capacity the capacity
 * @throws IllegalArgumentException if the header is not read successfully or
 *           the capacity is negative.
 * @throws IOException if there is a problem with the reader.
 * @deprecated instead of using this method in conjunction with the
 *             <code>readInstance(Reader)</code> method, one should use the
 *             <code>ArffLoader</code> or <code>DataSource</code> class
 *             instead.
 * @see weka.core.converters.ArffLoader
 * @see weka.core.converters.ConverterUtils.DataSource
 */
// @ requires capacity >= 0;
// @ ensures classIndex() == -1;
@Deprecated
public Instances(/* @non_null@ */Reader reader, int capacity) throws IOException {
 ArffReader arff = new ArffReader(reader, 0);
 Instances header = arff.getStructure();
 initialize(header, capacity);
 m_Lines = arff.getLineNo();
}

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

/**
 * Reads an ARFF file from a reader, and assigns a weight of one to each
 * instance. Lets the index of the class attribute be undefined (negative).
 * 
 * @param reader the reader
 * @throws IOException if the ARFF file is not read successfully
 */
public Instances(/* @non_null@ */Reader reader) throws IOException {
 ArffReader arff = new ArffReader(reader, 1000, false);
 initialize(arff.getData(), 1000);
 arff.setRetainStringValues(true);
 Instance inst;
 while ((inst = arff.readInstance(this)) != null) {
  m_Instances.add(inst);
 }
 compactify();
}

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

/**
 * Reads an ARFF file from a reader, and assigns a weight of one to each
 * instance. Lets the index of the class attribute be undefined (negative).
 * 
 * @param reader the reader
 * @throws IOException if the ARFF file is not read successfully
 */
public Instances(/* @non_null@ */Reader reader) throws IOException {
 ArffReader arff = new ArffReader(reader, 1000, false);
 initialize(arff.getData(), 1000);
 arff.setRetainStringValues(true);
 Instance inst;
 while ((inst = arff.readInstance(this)) != null) {
  m_Instances.add(inst);
 }
 compactify();
}

相关文章

Instances类方法