edu.cmu.minorthird.classify.experiments
Class Expt

java.lang.Object
  extended by edu.cmu.minorthird.classify.experiments.Expt
All Implemented Interfaces:
CommandLineProcessor.Configurable

public class Expt
extends java.lang.Object
implements CommandLineProcessor.Configurable

Simple experiment on a classifier.

Author:
William Cohen

Constructor Summary
Expt(ClassifierLearner learner, Dataset trainData, Dataset testData)
           
Expt(ClassifierLearner learner, Dataset trainData, Splitter<Example> splitter)
           
Expt(java.lang.String[] args)
          Convert a set of command-line arguments to an 'experiment' Examples: -learn \"new NaiveBayes()\" -train sample:toy -split k10 (k-fold CV) -learn \"new PoissonLearner()\" -train sample:toy -split s10 (stratified s-fold CV) -learn \"new AdaBoost(new DecisionTreeLearner())\" -train file:foo.data -split r70 -learn \"new AdaBoost()\" -train seqfile:foo.data -split r70
 
Method Summary
 CrossValidatedDataset crossValidatedDataset(boolean saveTrain)
           
 Evaluation evaluation()
           
 Classifier getClassifier()
           
 CommandLineProcessor getCLP()
          Produce a command-line processor that configures this object.
static void main(java.lang.String[] args)
           
static Dataset toDataset(java.lang.String datasetName)
          Decode dataset names.
static ClassifierLearner toLearner(java.lang.String learnerName)
          Decode learner name, which should be a legitimate java constructor, e.g.
static Splitter<Example> toSplitter(java.lang.String splitterName)
           
static
<T> Splitter<T>
toSplitter(java.lang.String splitterName, java.lang.Class<T> clazz)
          Decode splitter names.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expt

public Expt(ClassifierLearner learner,
            Dataset trainData,
            Dataset testData)

Expt

public Expt(ClassifierLearner learner,
            Dataset trainData,
            Splitter<Example> splitter)

Expt

public Expt(java.lang.String[] args)
     throws java.io.IOException
Convert a set of command-line arguments to an 'experiment' Examples: -learn \"new NaiveBayes()\" -train sample:toy -split k10 (k-fold CV) -learn \"new PoissonLearner()\" -train sample:toy -split s10 (stratified s-fold CV) -learn \"new AdaBoost(new DecisionTreeLearner())\" -train file:foo.data -split r70 -learn \"new AdaBoost()\" -train seqfile:foo.data -split r70

Throws:
java.io.IOException
Method Detail

getCLP

public CommandLineProcessor getCLP()
Description copied from interface: CommandLineProcessor.Configurable
Produce a command-line processor that configures this object.

Specified by:
getCLP in interface CommandLineProcessor.Configurable

evaluation

public Evaluation evaluation()

crossValidatedDataset

public CrossValidatedDataset crossValidatedDataset(boolean saveTrain)

getClassifier

public Classifier getClassifier()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toSplitter

public static <T> Splitter<T> toSplitter(java.lang.String splitterName,
                                         java.lang.Class<T> clazz)
Decode splitter names.


toSplitter

public static Splitter<Example> toSplitter(java.lang.String splitterName)

toDataset

public static Dataset toDataset(java.lang.String datasetName)
                         throws java.io.IOException
Decode dataset names. Allowed names are:

Throws:
java.io.IOException

toLearner

public static ClassifierLearner toLearner(java.lang.String learnerName)
Decode learner name, which should be a legitimate java constructor, e.g. new NaiveBayes().


main

public static void main(java.lang.String[] args)