本文整理了Java中weka.core.Option
类的一些代码示例,展示了Option
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Option
类的具体详情如下:
包路径:weka.core.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
/**
* Adds an Option for a flag to the list of options.
*
* @param options the options to extend
* @param text the description
* @param flag the flag (no dash)
*/
public static void addFlag(Vector options, String text, String flag) {
options.add(new Option("\t" + text, flag, 0, "-" + flag));
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* prints all the options to stdout
*/
protected static void printOptions(OptionHandler o) {
Enumeration<Option> enm = o.listOptions();
System.out.println("Options for " + o.getClass().getName() + ":\n");
while (enm.hasMoreElements()) {
Option option = enm.nextElement();
System.out.println(option.synopsis());
System.out.println(option.description());
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Removes an option from a given list of options.
*
* @param list the list to reduce
* @param name the name of the option
*/
public static void deleteOption(List<Option> list, String name) {
for (Iterator<Option> iter = list.listIterator(); iter.hasNext();) {
Option a = iter.next();
if (a.name().equals(name)) {
iter.remove();
}
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/LibSVM
new Option(
"\tSet type of SVM (default: 0)\n"
+ "\t\t 0 = C-SVC\n"
new Option(
"\tSet type of kernel function (default: 2)\n"
+ "\t\t 0 = linear: u'*v\n"
new Option(
"\tSet degree in kernel function (default: 3)",
"D", 1, "-D <int>"));
new Option(
"\tSet gamma in kernel function (default: 1/k)",
"G", 1, "-G <double>"));
new Option(
"\tSet coef0 in kernel function (default: 0)",
"R", 1, "-R <double>"));
new Option(
"\tSet the parameter C of C-SVC, epsilon-SVR, and nu-SVR\n"
+ "\t (default: 1)",
new Option(
"\tSet the parameter nu of nu-SVC, one-class SVM, and nu-SVR\n"
+ "\t (default: 0.5)",
new Option(
代码示例来源:origin: nz.ac.waikato.cms.weka/meka
public static void printOptions(Enumeration e) {
// Evaluation Options
StringBuffer text = new StringBuffer();
text.append("\n\nEvaluation Options:\n\n");
text.append("-t\n");
text.append("\tSpecify the dataset (required)\n");
text.append("-B <number of windows>\n");
text.append("\tSets the number of windows (batches) for evalutation; default: 20.\n");
text.append("-semisupervised <ratio labelled>\n");
text.append("\tSets the ratio of labelled instances; default: 1.0.\n");
// Multilabel Options
text.append("\n\nClassifier Options:\n\n");
while (e.hasMoreElements()) {
Option o = (Option) (e.nextElement());
text.append("-"+o.name()+'\n');
text.append(""+o.description()+'\n');
}
System.out.println(text);
}
代码示例来源:origin: Waikato/weka-trunk
/**
* returns all the options in a string
*
* @param generator the DataGenerator to return all the options for
* @return the assembled option string
*/
protected static String makeOptionString(DataGenerator generator) {
StringBuffer result;
Enumeration<Option> enm;
Option option;
result = new StringBuffer();
result.append("\nData Generator options:\n\n");
enm = generator.listOptions();
while (enm.hasMoreElements()) {
option = enm.nextElement();
// skip option if on blacklist
if (isOnBlacklist(option.name())) {
continue;
}
result.append(option.synopsis() + "\n" + option.description() + "\n");
}
return result.toString();
}
代码示例来源:origin: Waikato/wekaDeeplearning4j
/**
* Gets the current settings of the Classifier.
*
* @return an array of strings suitable for passing to setOptions
*/
@Override
public String[] getOptions() {
return Option.getOptions(this, this.getClass());
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
while (enm.hasMoreElements()) {
option = enm.nextElement();
if (isOnBlacklist(option.name())) {
pool.put(option.name(), option);
option = pool.get(enm2.nextElement());
try {
if (option.numArguments() == 0) {
Utils.getFlag(option.name(), options);
} else {
Utils.getOption(option.name(), options);
代码示例来源:origin: net.sf.meka/meka
while (e.hasMoreElements()) {
Option o = (Option) (e.nextElement());
text.append("-"+o.name()+'\n');
text.append(""+o.description()+'\n');
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* returns all the options in a string
*
* @param generator the DataGenerator to return all the options for
* @return the assembled option string
*/
protected static String makeOptionString(DataGenerator generator) {
StringBuffer result;
Enumeration<Option> enm;
Option option;
result = new StringBuffer();
result.append("\nData Generator options:\n\n");
enm = generator.listOptions();
while (enm.hasMoreElements()) {
option = enm.nextElement();
// skip option if on blacklist
if (isOnBlacklist(option.name())) {
continue;
}
result.append(option.synopsis() + "\n" + option.description() + "\n");
}
return result.toString();
}
代码示例来源:origin: Waikato/wekaDeeplearning4j
/**
* Gets the current settings of the Classifier.
*
* @return an array of strings suitable for passing to setOptions
*/
@Override
public String[] getOptions() {
return Option.getOptions(this, this.getClass());
}
代码示例来源:origin: Waikato/weka-trunk
while (enm.hasMoreElements()) {
option = enm.nextElement();
if (isOnBlacklist(option.name())) {
pool.put(option.name(), option);
option = pool.get(enm2.nextElement());
try {
if (option.numArguments() == 0) {
Utils.getFlag(option.name(), options);
} else {
Utils.getOption(option.name(), options);
代码示例来源:origin: Waikato/meka
/**
* Adds an Option for a flag to the list of options.
*
* @param options the options to extend
* @param text the description
* @param flag the flag (no dash)
*/
public static void addFlag(Vector options, String text, String flag) {
options.add(new Option("\t" + text, flag, 0, "-" + flag));
}
代码示例来源:origin: Waikato/weka-trunk
/**
* prints all the options to stdout
*/
protected static void printOptions(OptionHandler o) {
Enumeration<Option> enm = o.listOptions();
System.out.println("Options for " + o.getClass().getName() + ":\n");
while (enm.hasMoreElements()) {
Option option = enm.nextElement();
System.out.println(option.synopsis());
System.out.println(option.description());
}
}
代码示例来源:origin: Waikato/meka
while (e.hasMoreElements()) {
Option o = (Option) (e.nextElement());
text.append("-"+o.name()+'\n');
text.append(""+o.description()+'\n');
代码示例来源:origin: Waikato/wekaDeeplearning4j
/**
* Gets the current settings of the Classifier.
*
* @return an array of strings suitable for passing to setOptions
*/
@Override
public String[] getOptions() {
return Option.getOptions(this, this.getClass());
}
代码示例来源:origin: Waikato/weka-trunk
/**
* Removes an option from a given list of options.
*
* @param list the list to reduce
* @param name the name of the option
*/
public static void deleteOption(List<Option> list, String name) {
for (Iterator<Option> iter = list.listIterator(); iter.hasNext();) {
Option a = iter.next();
if (a.name().equals(name)) {
iter.remove();
}
}
}
代码示例来源:origin: Waikato/meka
/**
* Adds an Option for a flag to the list of options.
*
* @param options the options to extend
* @param text the description
* @param option the option (no dash)
*/
public static void addOption(Vector options, String text, String defValue, String option) {
options.add(new Option("\t" + text + "\n\t(default: " + defValue + ")", option, 0, "-" + option + " <value>"));
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* generates a string to print as help on the console
*
* @return the generated help
*/
public String generateHelp() {
String result;
Enumeration<Option> enm;
Option option;
result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n";
enm = listOptions();
while (enm.hasMoreElements()) {
option = enm.nextElement();
result += option.synopsis() + "\n" + option.description() + "\n";
}
return result;
}
代码示例来源:origin: nz.ac.waikato.cms.weka/meka
while (e.hasMoreElements()) {
Option o = (Option) (e.nextElement());
text.append("-"+o.name()+'\n');
text.append(""+o.description()+'\n');
内容来源于网络,如有侵权,请联系作者删除!