比如:
String []options=new String[4];
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 Sets training file. -T Sets test file. If missing, a cross-validation will be performed on the training data. -c Sets index of class attribute (default: last). -x Sets number of folds for cross-validation (default: 10). -no-cv Do not perform any cross validation. -split-percentage Sets the percentage for the train/test set split, e.g., 66. -preserve-order Preserves the order in the percentage split. -s Sets random number seed for cross-validation or percentage split (default: 1). -m Sets file with cost matrix. -l 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 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 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 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 The class label to determine the threshold data for (default is the first label)