本文整理汇总了Java中weka.core.Utils.checkForRemainingOptions方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.checkForRemainingOptions方法的具体用法?Java Utils.checkForRemainingOptions怎么用?Java Utils.checkForRemainingOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weka.core.Utils
的用法示例。
在下文中一共展示了Utils.checkForRemainingOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
@Override
public void setOptions(String[] options) throws Exception {
m_encodeMissingAsZero = Utils.getFlag('M', options);
m_insertDummyNominalFirstValue = Utils.getFlag('F', options);
Utils.checkForRemainingOptions(options);
}
示例2: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options. <p/>
*
<!-- options-start -->
* Valid options are: <p/>
*
* <pre> -B <num>
* Manual blend setting (default 20%)
* </pre>
*
* <pre> -E
* Enable entropic auto-blend setting (symbolic class only)
* </pre>
*
* <pre> -M <char>
* Specify the missing value treatment mode (default a)
* Valid options are: a(verage), d(elete), m(axdiff), n(ormal)
* </pre>
*
<!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
public void setOptions(String[] options) throws Exception {
String blendStr = Utils.getOption('B', options);
if (blendStr.length() != 0) {
setGlobalBlend(Integer.parseInt(blendStr));
}
setEntropicAutoBlend(Utils.getFlag('E', options));
String missingModeStr = Utils.getOption('M', options);
if (missingModeStr.length() != 0) {
switch ( missingModeStr.charAt(0) ) {
case 'a':
setMissingMode(new SelectedTag(M_AVERAGE, TAGS_MISSING));
break;
case 'd':
setMissingMode(new SelectedTag(M_DELETE, TAGS_MISSING));
break;
case 'm':
setMissingMode(new SelectedTag(M_MAXDIFF, TAGS_MISSING));
break;
case 'n':
setMissingMode(new SelectedTag(M_NORMAL, TAGS_MISSING));
break;
default:
setMissingMode(new SelectedTag(M_AVERAGE, TAGS_MISSING));
}
}
super.setOptions(options);
Utils.checkForRemainingOptions(options);
}
示例3: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -C <col>
* Sets the attribute index (default last).
* </pre>
*
* <pre>
* -F <value index>
* Sets the first value's index (default first).
* </pre>
*
* <pre>
* -S <value index>
* Sets the second value's index (default last).
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String attIndex = Utils.getOption('C', options);
if (attIndex.length() != 0) {
setAttributeIndex(attIndex);
} else {
setAttributeIndex("last");
}
String firstValIndex = Utils.getOption('F', options);
if (firstValIndex.length() != 0) {
setFirstValueIndex(firstValIndex);
} else {
setFirstValueIndex("first");
}
String secondValIndex = Utils.getOption('S', options);
if (secondValIndex.length() != 0) {
setSecondValueIndex(secondValIndex);
} else {
setSecondValueIndex("last");
}
if (getInputFormat() != null) {
setInputFormat(getInputFormat());
}
Utils.checkForRemainingOptions(options);
}
示例4: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -T <nominal|numeric|string|date|relational>
* Attribute type to delete. Valid options are "nominal",
* "numeric", "string", "date" and "relational".
* (default "string")
* </pre>
*
* <pre>
* -V
* Invert matching sense (i.e. only keep specified columns)
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String tString = Utils.getOption('T', options);
if (tString.length() != 0) {
setAttributeTypeString(tString);
}
setInvertSelection(Utils.getFlag('V', options));
if (getInputFormat() != null) {
setInputFormat(getInputFormat());
}
Utils.checkForRemainingOptions(options);
}
示例5: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -C <col>
* Sets the attribute index.
* </pre>
*
* <pre>
* -V <index1,index2-index4,...>
* Specify the list of values to indicate. First and last are
* valid indexes (default last)
* </pre>
*
* <pre>
* -N <index>
* Set if new boolean attribute nominal.
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String attIndex = Utils.getOption('C', options);
if (attIndex.length() != 0) {
setAttributeIndex(attIndex);
} else {
setAttributeIndex("last");
}
String valIndex = Utils.getOption('V', options);
if (valIndex.length() != 0) {
setValueIndices(valIndex);
} else {
setValueIndices("last");
}
setNumeric(!Utils.getFlag('N', options));
if (getInputFormat() != null) {
setInputFormat(getInputFormat());
}
Utils.checkForRemainingOptions(options);
}
示例6: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses the options for this object.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -i <the input file>
* The input file
* </pre>
*
* <pre>
* -o <the output file>
* The output file
* </pre>
*
* <pre>
* -C <class index>
* The class index (first and last are valid as well).
* (default: last)
* </pre>
*
* <pre>
* -compress
* Compresses the data (uses '.json.gz' as extension instead of '.json')
* (default: off)
* </pre>
*
* <!-- options-end -->
*
* @param options the options to use
* @throws Exception if setting of options fails
*/
@Override
public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption('C', options);
if (tmpStr.length() != 0) {
setClassIndex(tmpStr);
} else {
setClassIndex("last");
}
setCompressOutput(Utils.getFlag("compress", options));
super.setOptions(options);
Utils.checkForRemainingOptions(options);
}
示例7: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options. <p/>
*
<!-- options-start -->
* Valid options are: <p/>
*
* <pre> -X <number of folds>
* Number of folds used for cross validation (default 10).</pre>
*
* <pre> -P <classifier parameter>
* Classifier parameter options.
* eg: "N 1 5 10" Sets an optimisation parameter for the
* classifier with name -N, with lower bound 1, upper bound
* 5, and 10 optimisation steps. The upper bound may be the
* character 'A' or 'I' to substitute the number of
* attributes or instances in the training data,
* respectively. This parameter may be supplied more than
* once to optimise over several classifier options
* simultaneously.</pre>
*
* <pre> -S <num>
* Random number seed.
* (default 1)</pre>
*
* <pre> -D
* If set, classifier is run in debug mode and
* may output additional info to the console</pre>
*
* <pre> -W
* Full name of base classifier.
* (default: weka.classifiers.rules.ZeroR)</pre>
*
* <pre>
* Options specific to classifier weka.classifiers.rules.ZeroR:
* </pre>
*
* <pre> -D
* If set, classifier is run in debug mode and
* may output additional info to the console</pre>
*
<!-- options-end -->
*
* Options after -- are passed to the designated sub-classifier. <p>
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
public void setOptions(String[] options) throws Exception {
String foldsString = Utils.getOption('X', options);
if (foldsString.length() != 0) {
setNumFolds(Integer.parseInt(foldsString));
} else {
setNumFolds(10);
}
String cvParam;
m_CVParams = new Vector<CVParameter>();
do {
cvParam = Utils.getOption('P', options);
if (cvParam.length() != 0) {
addCVParameter(cvParam);
}
} while (cvParam.length() != 0);
super.setOptions(options);
Utils.checkForRemainingOptions(options);
}
示例8: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -K
* Use kernel density estimator rather than normal
* distribution for numeric attributes
* </pre>
*
* <pre>
* -D
* Use supervised discretization to process numeric attributes
* </pre>
*
* <pre>
* -O
* Display model in old format (good when there are many classes)
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @exception Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
super.setOptions(options);
boolean k = Utils.getFlag('K', options);
boolean d = Utils.getFlag('D', options);
if (k && d) {
throw new IllegalArgumentException("Can't use both kernel density "
+ "estimation and discretization!");
}
setUseSupervisedDiscretization(d);
setUseKernelEstimator(k);
setDisplayModelInOldFormat(Utils.getFlag('O', options));
Utils.checkForRemainingOptions(options);
}
示例9: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -E <expression>
* Specify the expression to apply. Eg a1^2*a5/log(a7*4.0).
* Supported opperators: ,+, -, *, /, ^, log, abs, cos,
* exp, sqrt, floor, ceil, rint, tan, sin, (, )
* (default: a1^2)
* </pre>
*
* <pre>
* -N <name>
* Specify the name for the new attribute. (default is the expression provided with -E)
* </pre>
*
* <pre>
* -D
* Debug. Names attribute with the postfix parse of the expression.
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String expString = Utils.getOption('E', options);
if (expString.length() != 0) {
setExpression(expString);
} else {
setExpression("a1^2");
}
String name = Utils.getOption('N', options);
if (name.length() != 0) {
setName(name);
}
setDebug(Utils.getFlag('D', options));
Utils.checkForRemainingOptions(options);
}
示例10: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -W <class name>
* The full class name of the classifier.
* eg: weka.classifiers.bayes.NaiveBayes
* </pre>
*
* <pre>
* -C <index>
* The index of the class for which IR statistics
* are to be output. (default 1)
* </pre>
*
* <pre>
* -I <index>
* The index of an attribute to output in the
* results. This attribute should identify an
* instance in order to know which instances are
* in the test set of a cross validation. if 0
* no output (default 0).
* </pre>
*
* <pre>
* -P
* Add target and prediction columns to the result
* for each fold.
* </pre>
*
* <pre>
* Options specific to classifier weka.classifiers.rules.ZeroR:
* </pre>
*
* <pre>
* -D
* If set, classifier is run in debug mode and
* may output additional info to the console
* </pre>
*
* <pre>
* -D <directory>
* Name of a directory to search for cost files when loading
* costs on demand (default current directory).
* </pre>
*
* <!-- options-end -->
*
* All options after -- will be passed to the classifier.
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String demandDir = Utils.getOption('D', options);
if (demandDir.length() != 0) {
setOnDemandDirectory(new File(demandDir));
}
super.setOptions(options);
Utils.checkForRemainingOptions(options);
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:70,代码来源:CostSensitiveClassifierSplitEvaluator.java
示例11: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses the options for this object.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -i <the input file>
* The input file
* </pre>
*
* <pre>
* -o <the output file>
* The output file
* </pre>
*
* <pre>
* -compress
* Compresses the data (uses '.arff.gz' as extension instead of '.arff')
* (default: off)
* </pre>
*
* <pre>
* -decimal <num>
* The maximum number of digits to print after the decimal
* place for numeric values (default: 6)
* </pre>
*
* <!-- options-end -->
*
* @param options the options to use
* @throws Exception if setting of options fails
*/
@Override
public void setOptions(String[] options) throws Exception {
setCompressOutput(Utils.getFlag("compress", options));
String tmpStr = Utils.getOption("decimal", options);
if (tmpStr.length() > 0) {
setMaxDecimalPlaces(Integer.parseInt(tmpStr));
}
super.setOptions(options);
Utils.checkForRemainingOptions(options);
}
示例12: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -S <num>
* Specify the random number seed (default 1)
* </pre>
*
* <pre>
* -Z <num>
* The size of the output dataset, as a percentage of
* the input dataset (default 100)
* </pre>
*
* <pre>
* -no-replacement
* Disables replacement of instances
* (default: with replacement)
* </pre>
*
* <pre>
* -V
* Inverts the selection - only available with '-no-replacement'.
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String tmpStr = Utils.getOption('S', options);
if (tmpStr.length() != 0) {
setRandomSeed(Integer.parseInt(tmpStr));
} else {
setRandomSeed(1);
}
tmpStr = Utils.getOption('Z', options);
if (tmpStr.length() != 0) {
setSampleSizePercent(Double.parseDouble(tmpStr));
} else {
setSampleSizePercent(100);
}
setNoReplacement(Utils.getFlag("no-replacement", options));
if (getNoReplacement()) {
setInvertSelection(Utils.getFlag('V', options));
}
if (getInputFormat() != null) {
setInputFormat(getInputFormat());
}
Utils.checkForRemainingOptions(options);
}
示例13: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -V
* Specifies if inverse of selection is to be output.
* </pre>
*
* <pre>
* -N <number of folds>
* Specifies number of folds dataset is split into.
* (default 10)
* </pre>
*
* <pre>
* -F <fold>
* Specifies which fold is selected. (default 1)
* </pre>
*
* <pre>
* -S <seed>
* Specifies random number seed. (default 0, no randomizing)
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
setInvertSelection(Utils.getFlag('V', options));
String numFolds = Utils.getOption('N', options);
if (numFolds.length() != 0) {
setNumFolds(Integer.parseInt(numFolds));
} else {
setNumFolds(10);
}
String fold = Utils.getOption('F', options);
if (fold.length() != 0) {
setFold(Integer.parseInt(fold));
} else {
setFold(1);
}
String seed = Utils.getOption('S', options);
if (seed.length() != 0) {
setSeed(Integer.parseInt(seed));
} else {
setSeed(0);
}
if (getInputFormat() != null) {
setInputFormat(getInputFormat());
}
Utils.checkForRemainingOptions(options);
}
示例14: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -C <col>
* Index of the attribute to be changed
* (default last attribute)
* </pre>
*
* <pre>
* -M
* Treat missing values as an extra value
* </pre>
*
* <pre>
* -P <num>
* Specify the percentage of noise introduced
* to the data (default 10)
* </pre>
*
* <pre>
* -S <num>
* Specify the random number seed (default 1)
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String indexString = Utils.getOption('C', options);
if (indexString.length() != 0) {
setAttributeIndex(indexString);
} else {
setAttributeIndex("last");
}
if (Utils.getFlag('M', options)) {
setUseMissing(true);
}
String percentString = Utils.getOption('P', options);
if (percentString.length() != 0) {
setPercent((int) Double.valueOf(percentString).doubleValue());
} else {
setPercent(10);
}
String seedString = Utils.getOption('S', options);
if (seedString.length() != 0) {
setRandomSeed(Integer.parseInt(seedString));
} else {
setRandomSeed(1);
}
Utils.checkForRemainingOptions(options);
}
示例15: setOptions
import weka.core.Utils; //导入方法依赖的package包/类
/**
* Parses a given list of options.
* <p/>
*
* <!-- options-start --> Valid options are:
* <p/>
*
* <pre>
* -C <num>
* Choose attribute to be used for selection.
* </pre>
*
* <pre>
* -N <num>
* Number of values to retain for the sepcified attribute,
* i.e. the ones with the most instances (default 2).
* </pre>
*
* <pre>
* -L
* Instead of values with the most instances the ones with the
* least are retained.
* </pre>
*
* <pre>
* -H
* When selecting on nominal attributes, removes header
* references to excluded values.
* </pre>
*
* <pre>
* -V
* Invert matching sense.
* </pre>
*
* <!-- options-end -->
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String attIndex = Utils.getOption('C', options);
if (attIndex.length() != 0) {
setAttributeIndex(attIndex);
} else {
setAttributeIndex("last");
}
String numValues = Utils.getOption('N', options);
if (numValues.length() != 0) {
setNumValues(Integer.parseInt(numValues));
} else {
setNumValues(2);
}
setUseLeastValues(Utils.getFlag('L', options));
setModifyHeader(Utils.getFlag('H', options));
setInvertSelection(Utils.getFlag('V', options));
if (getInputFormat() != null) {
setInputFormat(getInputFormat());
}
Utils.checkForRemainingOptions(options);
}