在JAVA中使用weka:预处理使用过滤器

NumericToNominal filter=new NumericToNominal();
String options[]=new String[2];
options[0]="-R";
options[1]="3,10";
filter.setOptions(options);
DataSource dataSource=new DataSource(trainFile[0].getAbsolutePath());
Instances instances=dataSource.getDataSet();
filter.setInputFormat(instances);
Instances newInstances = Filter.useFilter(instances, filter); 
System.out.println(newInstances.toSummaryString());

你可能感兴趣的:(weka过滤器)