【发布时间】:2018-03-29 13:54:55
【问题描述】:
我已经在 Weka 中进行了某种属性选择(信息增益)。之后,由于信息增益方法中每个属性的重要性,它返回具有新属性排列的新数据。我想删除一列或多列新数据,以便在我的数据集中拥有信息属性。 在这里你可以看到我的代码:
Instances data = new Instances(new BufferedReader(new FileReader("iris.arff")));
InfoGainAttributeEval eval = new InfoGainAttributeEval();
Ranker search = new Ranker();
AttributeSelection attSelect = new AttributeSelection();
attSelect.setEvaluator(eval);
attSelect.setSearch(search);
attSelect.SelectAttributes(data);
int[] indices = attSelect.selectedAttributes();
data = attSelect.reduceDimensionality(data); //re-arrange attributes but not remove them
提前致谢!
【问题讨论】: