//first fs.setEvaluator(wrapper); fs.setSearch(new BestFirst()); //then fs.SelectAttributes(data);
/** * Gets the current settings of BestFirst. * * @return an array of strings suitable for passing to setOptions() */ @Override public String[] getOptions() { Vector<String> options = new Vector<String>(); if (!(getStartSet().equals(""))) { options.add("-P"); options.add("" + startSetToString()); } options.add("-D"); options.add("" + m_searchDirection); options.add("-N"); options.add("" + m_maxStale); return options.toArray(new String[0]); }
/** * Constructor */ public BestFirst() { resetOptions(); }
public void setOptions(String[] options) throws Exception { String optionString; resetOptions(); setStartSet(optionString); setDirection(new SelectedTag(Integer.parseInt(optionString), TAGS_SELECTION)); } else { setDirection(new SelectedTag(SELECTION_FORWARD, TAGS_SELECTION)); setSearchTermination(Integer.parseInt(optionString)); setLookupCacheSize(Integer.parseInt(optionString));
if (!(getStartSet().equals(""))) { m_starting = m_startRange.getSelection(); } else { if (m_searchDirection == SELECTION_BACKWARD) { setStartSet("1-last"); m_starting = new int[m_numAttribs]; printGroup(tt, m_numAttribs); System.out.println("Merit: " + merit); return attributeList(best_group);
return getStartSet();
public void setOptions(String[] options) throws Exception { String optionString; resetOptions(); setStartSet(optionString); setDirection(new SelectedTag(Integer.parseInt(optionString), TAGS_SELECTION)); } else { setDirection(new SelectedTag(SELECTION_FORWARD, TAGS_SELECTION)); setSearchTermination(Integer.parseInt(optionString)); setLookupCacheSize(Integer.parseInt(optionString));
if (!(getStartSet().equals(""))) { m_starting = m_startRange.getSelection(); } else { if (m_searchDirection == SELECTION_BACKWARD) { setStartSet("1-last"); m_starting = new int[m_numAttribs]; printGroup(tt, m_numAttribs); System.out.println("Merit: " + merit); return attributeList(best_group);
/** Creates a default BestFirst */ public ASSearch getSearch() { return new BestFirst(); }
/** * Gets the current settings of BestFirst. * * @return an array of strings suitable for passing to setOptions() */ @Override public String[] getOptions() { Vector<String> options = new Vector<String>(); if (!(getStartSet().equals(""))) { options.add("-P"); options.add("" + startSetToString()); } options.add("-D"); options.add("" + m_searchDirection); options.add("-N"); options.add("" + m_maxStale); return options.toArray(new String[0]); }
/** * Constructor */ public BestFirst() { resetOptions(); }
/** Creates a default BestFirst */ public ASSearch getSearch() { return new BestFirst(); }
/** Creates a default BestFirst */ public ASSearch getSearch() { return new BestFirst(); }
/** Creates a default BestFirst */ public ASSearch getSearch() { return new BestFirst(); }
/** * returns the default attribute selection search scheme (fully configured) * for the attribute selection panel. * * @return the default search scheme, BestFirst by default */ public static Object getASSearch() { Object result; result = getObject("ASSearch", weka.attributeSelection.BestFirst.class.getName(), weka.attributeSelection.ASSearch.class); if (result == null) { result = new weka.attributeSelection.BestFirst(); } return result; }
/** * returns the default attribute selection search scheme (fully configured) * for the attribute selection panel. * * @return the default search scheme, BestFirst by default */ public static Object getASSearch() { Object result; result = getObject("ASSearch", weka.attributeSelection.BestFirst.class.getName(), weka.attributeSelection.ASSearch.class); if (result == null) { result = new weka.attributeSelection.BestFirst(); } return result; }
/** * set options to their default values */ protected void resetOptions() { m_trainSelector = new weka.attributeSelection.AttributeSelection(); setEvaluator(new CfsSubsetEval()); setSearch(new BestFirst()); m_SelectedAttributes = null; }
/** * set options to their default values */ protected void resetOptions() { m_trainSelector = new weka.attributeSelection.AttributeSelection(); setEvaluator(new CfsSubsetEval()); setSearch(new BestFirst()); m_SelectedAttributes = null; }
/** * Select attributes using BestFirst search to reduce * the number of parameters per instance of a dataset * * @param data input set of instances * @return resampled set of instances */ public static Instances selectAttributes(Instances data) { final AttributeSelection filter = new AttributeSelection(); Instances filteredIns = null; // Evaluator final CfsSubsetEval evaluator = new CfsSubsetEval(); evaluator.setMissingSeparate(true); // Assign evaluator to filter filter.setEvaluator(evaluator); // Search strategy: best first (default values) final BestFirst search = new BestFirst(); filter.setSearch(search); // Apply filter try { filter.setInputFormat(data); filteredIns = Filter.useFilter(data, filter); } catch (Exception e) { IJ.log("Error when resampling input data with selected attributes!"); e.printStackTrace(); } return filteredIns; }