/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ public Enumeration<Option> listOptions() { Vector<Option> newVector = new Vector<Option>(3); newVector.addElement(new Option( "\tFull name of base classifier.\n" + "\t(default: " + defaultClassifierString() + ((defaultClassifierOptions().length > 0) ? " with options " + Utils.joinOptions(defaultClassifierOptions()) + ")" : ")"), "W", 1, "-W <classifier name>")); newVector.addAll(Collections.list(super.listOptions())); newVector.addElement(new Option( "", "", 0, "\nOptions specific to classifier " + m_Classifier.getClass().getName() + ":")); newVector.addAll(Collections.list(((OptionHandler)m_Classifier).listOptions())); return newVector.elements(); }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ public Enumeration<Option> listOptions() { Vector<Option> newVector = new Vector<Option>(3); newVector.addElement(new Option( "\tFull name of base classifier.\n" + "\t(default: " + defaultClassifierString() + ((defaultClassifierOptions().length > 0) ? " with options " + Utils.joinOptions(defaultClassifierOptions()) + ")" : ")"), "W", 1, "-W <classifier name>")); newVector.addAll(Collections.list(super.listOptions())); newVector.addElement(new Option( "", "", 0, "\nOptions specific to classifier " + m_Classifier.getClass().getName() + ":")); newVector.addAll(Collections.list(((OptionHandler)m_Classifier).listOptions())); return newVector.elements(); }
/** * Parses a given list of options. Valid options are:<p> * * -W classname <br> * Specify the full class name of the base learner.<p> * * Options after -- are passed to the designated classifier.<p> * * @param options the list of options as an array of strings * @exception Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { super.setOptions(options); String classifierName = Utils.getOption('W', options); if (classifierName.length() > 0) { setClassifier(AbstractClassifier.forName(classifierName, null)); setClassifier(AbstractClassifier.forName(classifierName, Utils.partitionOptions(options))); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), null)); String[] classifierOptions = Utils.partitionOptions(options); if (classifierOptions.length > 0) { setClassifier(AbstractClassifier.forName(defaultClassifierString(), classifierOptions)); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), defaultClassifierOptions())); } } }
/** * Parses a given list of options. Valid options are:<p> * * -W classname <br> * Specify the full class name of the base learner.<p> * * Options after -- are passed to the designated classifier.<p> * * @param options the list of options as an array of strings * @exception Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { super.setOptions(options); String classifierName = Utils.getOption('W', options); if (classifierName.length() > 0) { setClassifier(AbstractClassifier.forName(classifierName, null)); setClassifier(AbstractClassifier.forName(classifierName, Utils.partitionOptions(options))); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), null)); String[] classifierOptions = Utils.partitionOptions(options); if (classifierOptions.length > 0) { setClassifier(AbstractClassifier.forName(defaultClassifierString(), classifierOptions)); } else { setClassifier(AbstractClassifier.forName(defaultClassifierString(), defaultClassifierOptions())); } } }