/** * Performs a attribute selection with the given search and evaluation scheme * on the provided data. The generated AttributeSelection object is returned. * * @param search the search scheme to use * @param eval the evaluator to use * @param data the data to work on * @return the used attribute selection object * @throws Exception if the attribute selection fails */ protected AttributeSelection search(ASSearch search, ASEvaluation eval, Instances data) throws Exception { AttributeSelection result; result = new AttributeSelection(); result.setSeed(42); result.setSearch(search); result.setEvaluator(eval); result.SelectAttributes(data); return result; }
/** * Performs a attribute selection with the given search and evaluation scheme * on the provided data. The generated AttributeSelection object is returned. * * @param search the search scheme to use * @param eval the evaluator to use * @param data the data to work on * @return the used attribute selection object * @throws Exception if the attribute selection fails */ protected AttributeSelection search(ASSearch search, ASEvaluation eval, Instances data) throws Exception { AttributeSelection result; result = new AttributeSelection(); result.setSeed(42); result.setSearch(search); result.setEvaluator(eval); result.SelectAttributes(data); return result; }
/** * constructor. Sets defaults for each member varaible. Default attribute * evaluator is CfsSubsetEval; default search method is BestFirst. */ public AttributeSelection() { setFolds(10); setRanking(false); setXval(false); setSeed(1); setEvaluator(new CfsSubsetEval()); setSearch(new GreedyStepwise()); m_selectionResults = new StringBuffer(); m_selectedAttributeSet = null; m_attributeRanking = null; }
/** * constructor. Sets defaults for each member varaible. Default attribute * evaluator is CfsSubsetEval; default search method is BestFirst. */ public AttributeSelection() { setFolds(10); setRanking(false); setXval(false); setSeed(1); setEvaluator(new CfsSubsetEval()); setSearch(new GreedyStepwise()); m_selectionResults = new StringBuffer(); m_selectedAttributeSet = null; m_attributeRanking = null; }
trainSelector.setSeed(seed);
trainSelector.setSeed(seed);
eval.setSearch(search); eval.setFolds(numFolds); eval.setSeed(seed); if (testMode == 1) { eval.setXval(true);
eval.setSearch(search); eval.setFolds(numFolds); eval.setSeed(seed); if (testMode == 1) { eval.setXval(true);
/** * Builds a model using the current scheme using the given data. * * @param data the instances to test the selection scheme on * @return a string containing the results. */ protected String useScheme(Instances data) throws Exception { AttributeSelection attsel = null; try { attsel = new AttributeSelection(); attsel.setSearch(m_Search); attsel.setEvaluator(m_Evaluator); attsel.setSeed(42); } catch (Exception e) { e.printStackTrace(); fail("Problem setting up attribute selection: " + e); } attsel.SelectAttributes(data); return attsel.toResultsString(); }
/** * Builds a model using the current scheme using the given data. * * @param data the instances to test the selection scheme on * @return a string containing the results. */ protected String useScheme(Instances data) throws Exception { AttributeSelection attsel = null; try { attsel = new AttributeSelection(); attsel.setSearch(m_Search); attsel.setEvaluator(m_Evaluator); attsel.setSeed(42); } catch (Exception e) { e.printStackTrace(); fail("Problem setting up attribute selection: " + e); } attsel.SelectAttributes(data); return attsel.toResultsString(); }