📄 racesearch.java
字号:
*/ public void setSignificanceLevel(double sig) { m_sigLevel = sig; } /** * Get the significance level * @return the current significance level */ public double getSignificanceLevel() { return m_sigLevel; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String thresholdTipText() { return "Set the error threshold by which to consider two subsets " +"equivalent."; } /** * Sets the threshold for comparisons * @param t the threshold to use */ public void setThreshold(double t) { m_delta = t; } /** * Get the threshold * @return the current threshold */ public double getThreshold() { return m_delta; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String foldsTypeTipText() { return "Set the number of folds to use for x-val error estimation; " +"leave-one-out is selected automatically for schemata search."; } /** * Set the xfold type * * @param d the type of xval */ public void setFoldsType (SelectedTag d) { if (d.getTags() == XVALTAGS_SELECTION) { m_xvalType = d.getSelectedTag().getID(); } } /** * Get the xfold type * * @return the type of xval */ public SelectedTag getFoldsType () { return new SelectedTag(m_xvalType, XVALTAGS_SELECTION); } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String debugTipText() { return "Turn on verbose output for monitoring the search's progress."; } /** * Set whether verbose output should be generated. * @param d true if output is to be verbose. */ public void setDebug(boolean d) { m_debug = d; } /** * Get whether output is to be verbose * @return true if output will be verbose */ public boolean getDebug() { return m_debug; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String attributeEvaluatorTipText() { return "Attribute evaluator to use for generating an initial ranking. " +"Use in conjunction with a rank race"; } /** * Set the attribute evaluator to use for generating the ranking. * @param newEvaluator the attribute evaluator to use. */ public void setAttributeEvaluator(ASEvaluation newEvaluator) { m_ASEval = newEvaluator; } /** * Get the attribute evaluator used to generate the ranking. * @return the evaluator used to generate the ranking. */ public ASEvaluation getAttributeEvaluator() { return m_ASEval; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String generateRankingTipText() { return "Use the racing process to generate a ranked list of attributes. " +"Using this mode forces the race to be a forward type and then races " +"until all attributes have been added, thus giving a ranked list"; } /** * Records whether the user has requested a ranked list of attributes. * @param doRank true if ranking is requested */ public void setGenerateRanking(boolean doRank) { m_rankingRequested = doRank; if (m_rankingRequested) { try { setRaceType(new SelectedTag(FORWARD_RACE, TAGS_SELECTION)); } catch (Exception ex) { } } } /** * Gets whether ranking has been requested. This is used by the * AttributeSelection module to determine if rankedAttributes() * should be called. * @return true if ranking has been requested. */ public boolean getGenerateRanking() { return m_rankingRequested; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String numToSelectTipText() { return "Specify the number of attributes to retain. Use in conjunction " +"with generateRanking. The default value " +"(-1) indicates that all attributes are to be retained. Use either " +"this option or a threshold to reduce the attribute set."; } /** * Specify the number of attributes to select from the ranked list * (if generating a ranking). -1 * indicates that all attributes are to be retained. * @param n the number of attributes to retain */ public void setNumToSelect(int n) { m_numToSelect = n; } /** * Gets the number of attributes to be retained. * @return the number of attributes to retain */ public int getNumToSelect() { return m_numToSelect; } /** * Gets the calculated number of attributes to retain. This is the * actual number of attributes to retain. This is the same as * getNumToSelect if the user specifies a number which is not less * than zero. Otherwise it should be the number of attributes in the * (potentially transformed) data. */ public int getCalculatedNumToSelect() { if (m_numToSelect >= 0) { m_calculatedNumToSelect = m_numToSelect; } return m_calculatedNumToSelect; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String selectionThresholdTipText() { return "Set threshold by which attributes can be discarded. Default value " + "results in no attributes being discarded. Use in conjunction with " + "generateRanking"; } /** * Set the threshold by which the AttributeSelection module can discard * attributes. * @param threshold the threshold. */ public void setSelectionThreshold(double threshold) { m_threshold = threshold; } /** * Returns the threshold so that the AttributeSelection module can * discard attributes from the ranking. */ public double getSelectionThreshold() { return m_threshold; } /** * Returns an enumeration describing the available options. * @return an enumeration of all the available options. **/ public Enumeration listOptions () { Vector newVector = new Vector(); newVector.addElement(new Option( "\tType of race to perform.\n" + "\t(default = 0).", "R", 1 ,"-R <0 = forward | 1 = backward race | 2 = schemata | 3 = rank>")); newVector.addElement(new Option( "\tSignificance level for comaparisons\n" + "\t(default = 0.001(forward/backward/rank)/0.01(schemata)).", "L",1,"-L <significance>")); newVector.addElement(new Option( "\tThreshold for error comparison.\n" + "\t(default = 0.001).", "T",1,"-T <threshold>")); newVector.addElement(new Option( "\tAttribute ranker to use if doing a \n" + "\trank search. Place any\n" + "\tevaluator options LAST on \n" + "\tthe command line following a \"--\".\n" + "\teg. -A weka.attributeSelection.GainRatioAttributeEval ... -- -M.\n" + "\t(default = GainRatioAttributeEval)", "A", 1, "-A <attribute evaluator>")); newVector.addElement(new Option( "\tFolds for cross validation\n" + "\t(default = 0 (1 if schemata race)", "F",1,"-F <0 = 10 fold | 1 = leave-one-out>")); newVector.addElement(new Option( "\tGenerate a ranked list of attributes.\n" +"\tForces the search to be forward\n" +"\tand races until all attributes have\n" +"\tselected, thus producing a ranking.", "Q",0,"-Q")); newVector.addElement(new Option( "\tSpecify number of attributes to retain from \n" + "\tthe ranking. Overides -T. Use in conjunction with -Q", "N", 1, "-N <num to select>")); newVector.addElement(new Option( "\tSpecify a theshold by which attributes\n" + "\tmay be discarded from the ranking.\n" +"\tUse in conjuction with -Q", "J",1, "-J <threshold>")); newVector.addElement(new Option( "\tVerbose output for monitoring the search.", "Z",0,"-Z")); if ((m_ASEval != null) && (m_ASEval instanceof OptionHandler)) { newVector.addElement(new Option( "", "", 0, "\nOptions specific to evaluator " + m_ASEval.getClass().getName() + ":")); Enumeration enu = ((OptionHandler)m_ASEval).listOptions(); while (enu.hasMoreElements()) { newVector.addElement(enu.nextElement()); } } return newVector.elements(); } /** * Parses a given list of options. <p/> * <!-- options-start --> * Valid options are: <p/> * * <pre> -R <0 = forward | 1 = backward race | 2 = schemata | 3 = rank> * Type of race to perform. * (default = 0).</pre> * * <pre> -L <significance> * Significance level for comaparisons * (default = 0.001(forward/backward/rank)/0.01(schemata)).</pre> * * <pre> -T <threshold> * Threshold for error comparison. * (default = 0.001).</pre> * * <pre> -A <attribute evaluator> * Attribute ranker to use if doing a * rank search. Place any * evaluator options LAST on * the command line following a "--". * eg. -A weka.attributeSelection.GainRatioAttributeEval ... -- -M. * (default = GainRatioAttributeEval)</pre> * * <pre> -F <0 = 10 fold | 1 = leave-one-out> * Folds for cross validation * (default = 0 (1 if schemata race)</pre> * * <pre> -Q * Generate a ranked list of attributes. * Forces the search to be forward * and races until all attributes have * selected, thus producing a ranking.</pre> * * <pre> -N <num to select> * Specify number of attributes to retain from * the ranking. Overides -T. Use in conjunction with -Q</pre> * * <pre> -J <threshold> * Specify a theshold by which attributes * may be discarded from the ranking. * Use in conjuction with -Q</pre> * * <pre> -Z * Verbose output for monitoring the search.</pre> * * <pre> * Options specific to evaluator weka.attributeSelection.GainRatioAttributeEval:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -