</pre>一、Instance 实例类<p></p><p>该类是用于处理一个有序的权重实例</p><p>典型的使用方法:</p><p></p><pre name="code" class="java">import weka.core.converters.ConverterUtils.DataSource;
...
// Read all the instances in the file (<strong><span style="color:#ff0000;">ARFF</span></strong>, CSV, XRFF, ...)
DataSource source = new DataSource(filename);
Instances instances = source.getDataSet();
// Make the last attribute be the class
instances.setClassIndex(instances.numAttributes() - 1);
// Print header and instances.
System.out.println("\nDataset:\n");
System.out.println(instances);
上面的实例初始化用到了DataSource类:
DataSource是一个接口,能过成为数据源的接口。
还有一种常用的方法:
<span style="white-space:pre"> </span>