Using+the+Experiment+API

toc = General = The class demonstrates the use of the Experiment API (stable 3.6 or developer version):
 * 1) setting up an experiment
 * 2) * one classifier
 * 3) * one or more datasets
 * 4) * classification or regression
 * 5) * cross-validation or random split
 * 6) running the experiment
 * 7) evaluating the experiment and outputting the results

Classes of the Experiment API being used: > see [|Claude Nadeau, Yoshua Bengio (2001). Inference for the Generalization Error. Machine Learning.]
 * - the class for peforming experiments
 * - for classification
 * - for regression
 * - for cross-validation
 * - for random splits
 * - for storing the results of the experiment, used as input for the TTester algorithm
 * - for generating the statistics
 * - for storing the statistics

= Examples = Usage: code format="bash" java ExperimentDemo -classifier  -exptype  -splittype  -runs <# of runs> -folds  -percentage -result  -t (can be supplied multiple times) code

Classification
An example run with J48 and two UCI datasets: code format="bash" java ExperimentDemo -classifier weka.classifiers.trees.J48 -exptype classification -splittype crossvalidation -runs 10 -folds 10 -result /some/where/results.arff -t vote.arff -t iris.arff code And the output: code format="text" Setting up... Initializing...  Running...  Finishing...  Evaluating... Result: (1) vote Perc. correct: 96.57135311000002 StdDev: 2.560851001842444 (2) iris Perc. correct: 94.73333325999994 StdDev: 5.300826810632913 code

Regression
Another example with M5P and two numeric UCI datasets: code format="bash" java ExperimentDemo -classifier weka.classifiers.trees.M5P -exptype regression -splittype randomsplit -runs 10 -percentage 66 -result /some/where/results.arff -t bolts.arff -t bodyfat.arff code And the associated output: code format="text" Setting up... Initializing...  Running...  Finishing...  Evaluating... Result: (1) bolts Perc. correct: 0.9701825 StdDev: 0.017970627641614084 (2) bodyfat.names Perc. correct: 0.9795883 StdDev: 0.011646527074622525 code

= See also =
 * Use Weka in your Java code - for general use of the Weka API

= Downloads =
 * [[file:ExperimentDemo.java]] ([|stable-3.6], [|developer])