/** * Gets the currently set performance evaluation measure used for selecting * attributes for the decision table * * @return the performance evaluation measure */ public SelectedTag getEvaluationMeasure() { return new SelectedTag(m_evaluationMeasure.getIDStr(), TAGS_EVALUATION); }
/** * Gets the currently set performance evaluation measure used for selecting * attributes for the decision table * * @return the performance evaluation measure */ public SelectedTag getEvaluationMeasure() { return new SelectedTag(m_evaluationMeasure.getIDStr(), TAGS_EVALUATION); }
/** * Gets the currently set performance evaluation measure used for selecting * attributes for the decision table * * @return the performance evaluation measure */ public SelectedTag getEvaluationMeasure() { return new SelectedTag(m_evaluationMeasure.getIDStr(), TAGS_EVALUATION); }
/** * Gets the currently set performance evaluation measure used for selecting * attributes for the decision table * * @return the performance evaluation measure */ public SelectedTag getEvaluationMeasure() { return new SelectedTag(m_evaluationMeasure.getIDStr(), TAGS_EVALUATION); }
/** * returns a string that can be used in the listOption methods to list all * the available options, i.e., "\t\tID = Text\n" for each option * * @param tags the tags to create the string for * @return a string explaining the tags */ public static String toOptionSynopsis(Tag[] tags) { String result; int i; result = ""; for (i = 0; i < tags.length; i++) { result += "\t\t" + tags[i].getIDStr() + " = " + tags[i].getReadable() + "\n"; } return result; }
/** * Creates a new <code>SelectedTag</code> instance. * * @param tagText the text of the selected tag (case-insensitive). * @param tags an array containing the possible valid Tags. * @throws IllegalArgumentException if the selected tag isn't in the array * of valid values. */ public SelectedTag(String tagText, Tag[] tags) { for (int i = 0; i < tags.length; i++) { if ( tags[i].getReadable().equalsIgnoreCase(tagText) || tags[i].getIDStr().equalsIgnoreCase(tagText) ) { m_Selected = i; m_Tags = tags; return; } } throw new IllegalArgumentException("Selected tag is not valid"); }
/** * returns a string that can be used in the listOption methods to list all * the available options, i.e., "\t\tID = Text\n" for each option * * @param tags the tags to create the string for * @return a string explaining the tags */ public static String toOptionSynopsis(Tag[] tags) { String result; int i; result = ""; for (i = 0; i < tags.length; i++) { result += "\t\t" + tags[i].getIDStr() + " = " + tags[i].getReadable() + "\n"; } return result; }
/** * Creates a new <code>SelectedTag</code> instance. * * @param tagText the text of the selected tag (case-insensitive). * @param tags an array containing the possible valid Tags. * @throws IllegalArgumentException if the selected tag isn't in the array * of valid values. */ public SelectedTag(String tagText, Tag[] tags) { for (int i = 0; i < tags.length; i++) { if ( tags[i].getReadable().equalsIgnoreCase(tagText) || tags[i].getIDStr().equalsIgnoreCase(tagText) ) { m_Selected = i; m_Tags = tags; return; } } throw new IllegalArgumentException("Selected tag is not valid"); }
/** * Set the evaluation metric to use * * @param metric the metric to use */ public void setEvaluationMetric(SelectedTag metric) { if (metric.getTags() == TAGS_EVAL) { m_evalMetric = metric.getSelectedTag().getIDStr(); } }
/** * Get the evaluation metric to use * * @return the evaluation metric to use */ public SelectedTag getEvaluationMetric() { for (int i = 0; i < TAGS_EVAL.length; i++) { if (TAGS_EVAL[i].getIDStr().equalsIgnoreCase(m_evalMetric)) { return new SelectedTag(i, TAGS_EVAL); } } // if we get here then it could be because a plugin // metric is no longer available. Default to rmse return new SelectedTag(12, TAGS_EVAL); }
/** * Set the evaluation metric to use * * @param metric the metric to use */ public void setEvaluationMetric(SelectedTag metric) { if (metric.getTags() == TAGS_EVAL) { m_evalMetric = metric.getSelectedTag().getIDStr(); } }
/** * Get the evaluation metric to use * * @return the evaluation metric to use */ public SelectedTag getEvaluationMetric() { for (int i = 0; i < TAGS_EVAL.length; i++) { if (TAGS_EVAL[i].getIDStr().equalsIgnoreCase(m_evalMetric)) { return new SelectedTag(i, TAGS_EVAL); } } // if we get here then it could be because a plugin // metric is no longer available. Default to rmse return new SelectedTag(12, TAGS_EVAL); }
throw new IllegalArgumentException("The IDs are not unique: " + newID + "!"); String IDstring = tags[i].getIDStr(); if (!IDStr.contains(IDstring)) { IDStr.add(IDstring);
options[current++] = m_evaluationMeasure.getIDStr();
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option( "\tSpecify list of attributes to process.\n" + "\t(default: select all nominal attributes)", "R", 1, "-R <index1,index2-index4,...>")); result.addElement(new Option( "\tInverts the matching sense of the selection.", "V", 0, "-V")); String desc = ""; for (Tag element : TAGS_SORTTYPE) { SelectedTag tag = new SelectedTag(element.getID(), TAGS_SORTTYPE); desc += "\t" + tag.getSelectedTag().getIDStr() + " = " + tag.getSelectedTag().getReadable() + "\n"; } result.addElement(new Option("\tDetermines the type of sorting:\n" + desc + "\t(default: " + new SelectedTag(SORT_CASESENSITIVE, TAGS_SORTTYPE) + ")", "S", 1, "-S " + Tag.toOptionList(TAGS_SORTTYPE))); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option( "\tSpecify list of attributes to process.\n" + "\t(default: select all nominal attributes)", "R", 1, "-R <index1,index2-index4,...>")); result.addElement(new Option( "\tInverts the matching sense of the selection.", "V", 0, "-V")); String desc = ""; for (Tag element : TAGS_SORTTYPE) { SelectedTag tag = new SelectedTag(element.getID(), TAGS_SORTTYPE); desc += "\t" + tag.getSelectedTag().getIDStr() + " = " + tag.getSelectedTag().getReadable() + "\n"; } result.addElement(new Option("\tDetermines the type of sorting:\n" + desc + "\t(default: " + new SelectedTag(SORT_CASESENSITIVE, TAGS_SORTTYPE) + ")", "S", 1, "-S " + Tag.toOptionList(TAGS_SORTTYPE))); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
/** * returns a string representation of this performance object. * * @return a string representation */ @Override public String toString() { String result; String evalStr; evalStr = null; if (m_Metrics != null) { for (Tag tag: m_Metrics.getTags()) { if (tag.getID() == m_Evaluation) { evalStr = tag.getIDStr(); break; } } } if (evalStr == null) evalStr = "" + m_Evaluation; result = "Performance (" + getValues() + "): "; result += getPerformance() + " (" + evalStr + ")"; return result; } }
/** * Gets an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> result; String desc; SelectedTag tag; int i; result = new Vector<Option>(); desc = ""; for (i = 0; i < TAGS_GUI.length; i++) { tag = new SelectedTag(TAGS_GUI[i].getID(), TAGS_GUI); desc += "\t" + tag.getSelectedTag().getIDStr() + " = " + tag.getSelectedTag().getReadable() + "\n"; } result.addElement(new Option("\tDetermines the layout of the GUI:\n" + desc + "\t(default: " + new SelectedTag(GUI_MDI, TAGS_GUI) + ")", "gui", 1, "-gui " + Tag.toOptionList(TAGS_GUI))); return result.elements(); }
/** * Gets an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> result; String desc; SelectedTag tag; int i; result = new Vector<Option>(); desc = ""; for (i = 0; i < TAGS_GUI.length; i++) { tag = new SelectedTag(TAGS_GUI[i].getID(), TAGS_GUI); desc += "\t" + tag.getSelectedTag().getIDStr() + " = " + tag.getSelectedTag().getReadable() + "\n"; } result.addElement(new Option("\tDetermines the layout of the GUI:\n" + desc + "\t(default: " + new SelectedTag(GUI_MDI, TAGS_GUI) + ")", "gui", 1, "-gui " + Tag.toOptionList(TAGS_GUI))); return result.elements(); }
for (i = 0; i < m_Metrics.getTags().length; i++) { tag = new SelectedTag(m_Metrics.getTags()[i].getID(), m_Metrics.getTags()); desc += "\t" + tag.getSelectedTag().getIDStr() + " = " + tag.getSelectedTag().getReadable() + "\n";