我想使用一组选定的属性创建一个新的 arff 数据集。我选择了 20 个随机索引。如何使用这些选定的属性创建一个新的 arff 文件?
int indices;
DataSource source = new DataSource("E:/dataset/lukemia.arff");
Instances toreduce = source.getDataSet();
Random generator = new Random();
for(int i=0;i<20;i++)
{
indices = generator.nextInt(toreduce.numAttributes());
System.out.println(indices);
}