private int[] ReduceByPCA(weka.core.Instances insts) { int[] rang = null; PrincipalComponents filter = new PrincipalComponents(); // package weka.filters.supervised.attribute! filter.setTransformBackToOriginal(true); filter.buildEvaluator(insts); Ranker search2 = new Ranker(); // search2.setNumToSelect(2); search2.setGenerateRanking(true); rang = search2.search(filter, insts); return rang; }
private int[] ReduceByInfoGain(weka.core.Instances insts) { weka.attributeSelection.InfoGainAttributeEval AttribEvaluator = new weka.attributeSelection.InfoGainAttributeEval(); AttribEvaluator.buildEvaluator(insts); Ranker search2 = new Ranker(); int[] rang = search2.search(AttribEvaluator, insts); return rang; }