在Java中使用weka:options参数设置

比如:

<span style="white-space:pre">	</span>String []options=new String[4];
<span style="white-space:pre">	</span>options[0]="-t";
	options[1]="E:\\Program Files\\Weka-3-6\\data\\segment-challenge.arff";
	options[2]="-T";
	options[3]="E:\\Program Files\\Weka-3-6\\data\\segment-test.arff";
	System.out.println(Evaluation.evaluateModel(new ZeroR(), options));

General options:


-h or -help
Output help information.
-synopsis or -info
Output synopsis for classifier (use in conjunction  with -h)
-t <name of training file>
Sets training file.
-T <name of test file>
Sets test file. If missing, a cross-validation will be performed
on the training data.
-c <class index>
Sets index of class attribute (default: last).
-x <number of folds>
Sets number of folds for cross-validation (default: 10).
-no-cv
Do not perform any cross validation.
-split-percentage <percentage>
Sets the percentage for the train/test set split, e.g., 66.
-preserve-order
Preserves the order in the percentage split.
-s <random number seed>
Sets random number seed for cross-validation or percentage split
(default: 1).
-m <name of file with cost matrix>
Sets file with cost matrix.
-l <name of input file>
Sets model input file. In case the filename ends with '.xml',
a PMML file is loaded or, if that fails, options are loaded
from the XML file.
-d <name of output file>
Sets model output file. In case the filename ends with '.xml',
only the options are saved to the XML file, not the model.
-v
Outputs no statistics for training data.
-o
Outputs statistics only, not the classifier.
-i
Outputs detailed information-retrieval statistics for each class.
-k
Outputs information-theoretic statistics.
-p <attribute range>
Only outputs predictions for test instances (or the train
instances if no test instances provided and -no-cv is used),
along with attributes (0 for none).
-distribution
Outputs the distribution instead of only the prediction
in conjunction with the '-p' option (only nominal classes).
-r
Only outputs cumulative margin distribution.
-xml filename | xml-string
Retrieves the options from the XML-data instead of the command line.
-threshold-file <file>
The file to save the threshold data to.
The format is determined by the extensions, e.g., '.arff' for ARFF 
format or '.csv' for CSV.
-threshold-label <label>
The class label to determine the threshold data for
(default is the first label)

你可能感兴趣的:(java,数据挖掘,weka,options参数设置)