weka.core.Option类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中weka.core.Option类的一些代码示例,展示了Option类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Option类的具体详情如下:
包路径:weka.core.Option
类名称:Option

Option介绍

[英]Class to store information about an option.

Typical usage:

Option myOption = new Option("Uses extended mode.", "E", 0, "-E"));
[中]类来存储有关选项的信息。
典型用法:
Option myOption = new Option("Uses extended mode.", "E", 0, "-E"));

代码示例

代码示例来源:origin: net.sf.meka/meka

  1. /**
  2. * Adds an Option for a flag to the list of options.
  3. *
  4. * @param options the options to extend
  5. * @param text the description
  6. * @param flag the flag (no dash)
  7. */
  8. public static void addFlag(Vector options, String text, String flag) {
  9. options.add(new Option("\t" + text, flag, 0, "-" + flag));
  10. }

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

  1. /**
  2. * prints all the options to stdout
  3. */
  4. protected static void printOptions(OptionHandler o) {
  5. Enumeration<Option> enm = o.listOptions();
  6. System.out.println("Options for " + o.getClass().getName() + ":\n");
  7. while (enm.hasMoreElements()) {
  8. Option option = enm.nextElement();
  9. System.out.println(option.synopsis());
  10. System.out.println(option.description());
  11. }
  12. }

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

  1. /**
  2. * Removes an option from a given list of options.
  3. *
  4. * @param list the list to reduce
  5. * @param name the name of the option
  6. */
  7. public static void deleteOption(List<Option> list, String name) {
  8. for (Iterator<Option> iter = list.listIterator(); iter.hasNext();) {
  9. Option a = iter.next();
  10. if (a.name().equals(name)) {
  11. iter.remove();
  12. }
  13. }
  14. }

代码示例来源:origin: nz.ac.waikato.cms.weka/LibSVM

  1. new Option(
  2. "\tSet type of SVM (default: 0)\n"
  3. + "\t\t 0 = C-SVC\n"
  4. new Option(
  5. "\tSet type of kernel function (default: 2)\n"
  6. + "\t\t 0 = linear: u'*v\n"
  7. new Option(
  8. "\tSet degree in kernel function (default: 3)",
  9. "D", 1, "-D <int>"));
  10. new Option(
  11. "\tSet gamma in kernel function (default: 1/k)",
  12. "G", 1, "-G <double>"));
  13. new Option(
  14. "\tSet coef0 in kernel function (default: 0)",
  15. "R", 1, "-R <double>"));
  16. new Option(
  17. "\tSet the parameter C of C-SVC, epsilon-SVR, and nu-SVR\n"
  18. + "\t (default: 1)",
  19. new Option(
  20. "\tSet the parameter nu of nu-SVC, one-class SVM, and nu-SVR\n"
  21. + "\t (default: 0.5)",
  22. new Option(

代码示例来源:origin: nz.ac.waikato.cms.weka/meka

  1. public static void printOptions(Enumeration e) {
  2. // Evaluation Options
  3. StringBuffer text = new StringBuffer();
  4. text.append("\n\nEvaluation Options:\n\n");
  5. text.append("-t\n");
  6. text.append("\tSpecify the dataset (required)\n");
  7. text.append("-B <number of windows>\n");
  8. text.append("\tSets the number of windows (batches) for evalutation; default: 20.\n");
  9. text.append("-semisupervised <ratio labelled>\n");
  10. text.append("\tSets the ratio of labelled instances; default: 1.0.\n");
  11. // Multilabel Options
  12. text.append("\n\nClassifier Options:\n\n");
  13. while (e.hasMoreElements()) {
  14. Option o = (Option) (e.nextElement());
  15. text.append("-"+o.name()+'\n');
  16. text.append(""+o.description()+'\n');
  17. }
  18. System.out.println(text);
  19. }

代码示例来源:origin: Waikato/weka-trunk

  1. /**
  2. * returns all the options in a string
  3. *
  4. * @param generator the DataGenerator to return all the options for
  5. * @return the assembled option string
  6. */
  7. protected static String makeOptionString(DataGenerator generator) {
  8. StringBuffer result;
  9. Enumeration<Option> enm;
  10. Option option;
  11. result = new StringBuffer();
  12. result.append("\nData Generator options:\n\n");
  13. enm = generator.listOptions();
  14. while (enm.hasMoreElements()) {
  15. option = enm.nextElement();
  16. // skip option if on blacklist
  17. if (isOnBlacklist(option.name())) {
  18. continue;
  19. }
  20. result.append(option.synopsis() + "\n" + option.description() + "\n");
  21. }
  22. return result.toString();
  23. }

代码示例来源:origin: Waikato/wekaDeeplearning4j

  1. /**
  2. * Gets the current settings of the Classifier.
  3. *
  4. * @return an array of strings suitable for passing to setOptions
  5. */
  6. @Override
  7. public String[] getOptions() {
  8. return Option.getOptions(this, this.getClass());
  9. }

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

  1. while (enm.hasMoreElements()) {
  2. option = enm.nextElement();
  3. if (isOnBlacklist(option.name())) {
  4. pool.put(option.name(), option);
  5. option = pool.get(enm2.nextElement());
  6. try {
  7. if (option.numArguments() == 0) {
  8. Utils.getFlag(option.name(), options);
  9. } else {
  10. Utils.getOption(option.name(), options);

代码示例来源:origin: net.sf.meka/meka

  1. while (e.hasMoreElements()) {
  2. Option o = (Option) (e.nextElement());
  3. text.append("-"+o.name()+'\n');
  4. text.append(""+o.description()+'\n');

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

  1. /**
  2. * returns all the options in a string
  3. *
  4. * @param generator the DataGenerator to return all the options for
  5. * @return the assembled option string
  6. */
  7. protected static String makeOptionString(DataGenerator generator) {
  8. StringBuffer result;
  9. Enumeration<Option> enm;
  10. Option option;
  11. result = new StringBuffer();
  12. result.append("\nData Generator options:\n\n");
  13. enm = generator.listOptions();
  14. while (enm.hasMoreElements()) {
  15. option = enm.nextElement();
  16. // skip option if on blacklist
  17. if (isOnBlacklist(option.name())) {
  18. continue;
  19. }
  20. result.append(option.synopsis() + "\n" + option.description() + "\n");
  21. }
  22. return result.toString();
  23. }

代码示例来源:origin: Waikato/wekaDeeplearning4j

  1. /**
  2. * Gets the current settings of the Classifier.
  3. *
  4. * @return an array of strings suitable for passing to setOptions
  5. */
  6. @Override
  7. public String[] getOptions() {
  8. return Option.getOptions(this, this.getClass());
  9. }

代码示例来源:origin: Waikato/weka-trunk

  1. while (enm.hasMoreElements()) {
  2. option = enm.nextElement();
  3. if (isOnBlacklist(option.name())) {
  4. pool.put(option.name(), option);
  5. option = pool.get(enm2.nextElement());
  6. try {
  7. if (option.numArguments() == 0) {
  8. Utils.getFlag(option.name(), options);
  9. } else {
  10. Utils.getOption(option.name(), options);

代码示例来源:origin: Waikato/meka

  1. /**
  2. * Adds an Option for a flag to the list of options.
  3. *
  4. * @param options the options to extend
  5. * @param text the description
  6. * @param flag the flag (no dash)
  7. */
  8. public static void addFlag(Vector options, String text, String flag) {
  9. options.add(new Option("\t" + text, flag, 0, "-" + flag));
  10. }

代码示例来源:origin: Waikato/weka-trunk

  1. /**
  2. * prints all the options to stdout
  3. */
  4. protected static void printOptions(OptionHandler o) {
  5. Enumeration<Option> enm = o.listOptions();
  6. System.out.println("Options for " + o.getClass().getName() + ":\n");
  7. while (enm.hasMoreElements()) {
  8. Option option = enm.nextElement();
  9. System.out.println(option.synopsis());
  10. System.out.println(option.description());
  11. }
  12. }

代码示例来源:origin: Waikato/meka

  1. while (e.hasMoreElements()) {
  2. Option o = (Option) (e.nextElement());
  3. text.append("-"+o.name()+'\n');
  4. text.append(""+o.description()+'\n');

代码示例来源:origin: Waikato/wekaDeeplearning4j

  1. /**
  2. * Gets the current settings of the Classifier.
  3. *
  4. * @return an array of strings suitable for passing to setOptions
  5. */
  6. @Override
  7. public String[] getOptions() {
  8. return Option.getOptions(this, this.getClass());
  9. }

代码示例来源:origin: Waikato/weka-trunk

  1. /**
  2. * Removes an option from a given list of options.
  3. *
  4. * @param list the list to reduce
  5. * @param name the name of the option
  6. */
  7. public static void deleteOption(List<Option> list, String name) {
  8. for (Iterator<Option> iter = list.listIterator(); iter.hasNext();) {
  9. Option a = iter.next();
  10. if (a.name().equals(name)) {
  11. iter.remove();
  12. }
  13. }
  14. }

代码示例来源:origin: Waikato/meka

  1. /**
  2. * Adds an Option for a flag to the list of options.
  3. *
  4. * @param options the options to extend
  5. * @param text the description
  6. * @param option the option (no dash)
  7. */
  8. public static void addOption(Vector options, String text, String defValue, String option) {
  9. options.add(new Option("\t" + text + "\n\t(default: " + defValue + ")", option, 0, "-" + option + " <value>"));
  10. }

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

  1. /**
  2. * generates a string to print as help on the console
  3. *
  4. * @return the generated help
  5. */
  6. public String generateHelp() {
  7. String result;
  8. Enumeration<Option> enm;
  9. Option option;
  10. result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n";
  11. enm = listOptions();
  12. while (enm.hasMoreElements()) {
  13. option = enm.nextElement();
  14. result += option.synopsis() + "\n" + option.description() + "\n";
  15. }
  16. return result;
  17. }

代码示例来源:origin: nz.ac.waikato.cms.weka/meka

  1. while (e.hasMoreElements()) {
  2. Option o = (Option) (e.nextElement());
  3. text.append("-"+o.name()+'\n');
  4. text.append(""+o.description()+'\n');

相关文章