【发布时间】:2017-06-07 00:12:59
【问题描述】:
protected static void attSelection_w(Instances data) throws Exception {
AttributeSelection fs = new AttributeSelection();
WrapperSubsetEval wrapper = new WrapperSubsetEval();
wrapper.buildEvaluator(data);
wrapper.setClassifier(new RandomForest());
wrapper.setFolds(10);
wrapper.setThreshold(0.001);
fs.SelectAttributes(data);
fs.setEvaluator(wrapper);
fs.setSearch(new BestFirst());
System.out.println(fs.toResultsString());
}
以上是我使用随机森林 + bestfirst 搜索进行基于包装的属性选择的代码。但是,这会以某种方式使用 cfs 吐出结果,如下所示。
Search Method:
Greedy Stepwise (forwards).
Start set: no attributes
Merit of best subset found: 0.287
Attribute Subset Evaluator (supervised, Class (nominal): 9 class):
CFS Subset Evaluator
Including locally predictive attributes
在整个班级中没有其他代码使用 CFS,而且我几乎被困住了。如果有任何帮助,我将不胜感激。谢谢!
【问题讨论】:
标签: java attributes selection weka feature-selection