csli.util.classify.berkeley
Class C4_5Learner

java.lang.Object
  extended by csli.util.classify.berkeley.C4_5Learner
All Implemented Interfaces:
Learner

public class C4_5Learner
extends Object
implements Learner

Interface for C4.5 decision tree learner/classifier

Author:
mpurver

Constructor Summary
C4_5Learner()
           
 
Method Summary
 ClassificationSet[] classify(TrainingSet testData)
          Classify some test data.
 void init(String fileStem)
          Initialise model & output files, training and classification commands.
 void setModel(File modelFile)
          Set a classification model from file (as an alternative to training - although some classifiers (e.g.
 String toString(ClassificationSet data)
          String conversion for particular learner file format.
 String toString(FeatureSet data)
          String conversion for particular learner file format.
 String toString(TrainingSet data)
          String conversion for particular learner file format.
 String toString(TrainingType data)
          String conversion for particular learner file format.
 boolean train(TrainingSet trainingData)
          Learn a model from training data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C4_5Learner

public C4_5Learner()
Method Detail

init

public void init(String fileStem)
Description copied from interface: Learner
Initialise model & output files, training and classification commands.

Specified by:
init in interface Learner
Parameters:
fileStem - the filestem to user for model/result files

train

public boolean train(TrainingSet trainingData)
Description copied from interface: Learner
Learn a model from training data. Should return false on error.

Specified by:
train in interface Learner
Parameters:
trainingData - the training data to learn from

setModel

public void setModel(File modelFile)
Description copied from interface: Learner
Set a classification model from file (as an alternative to training - although some classifiers (e.g. Svm, C4_5) work from model files anyway, in which case initial setup does all you need). Should throw RuntimeException on error.

Specified by:
setModel in interface Learner
Parameters:
modelFile - the model file (format learner-dependent)

classify

public ClassificationSet[] classify(TrainingSet testData)
Description copied from interface: Learner
Classify some test data. Should return NULL on error.

Specified by:
classify in interface Learner
Parameters:
testData - the test data to classify
Returns:
the classification set

toString

public String toString(TrainingSet data)
Description copied from interface: Learner
String conversion for particular learner file format.

Specified by:
toString in interface Learner
Parameters:
data - the data to convert
Returns:
the String representation

toString

public String toString(TrainingType data)
Description copied from interface: Learner
String conversion for particular learner file format.

Specified by:
toString in interface Learner
Parameters:
data - the data to convert
Returns:
the String representation

toString

public String toString(FeatureSet data)
Description copied from interface: Learner
String conversion for particular learner file format.

Specified by:
toString in interface Learner
Parameters:
data - the data to convert
Returns:
the String representation

toString

public String toString(ClassificationSet data)
Description copied from interface: Learner
String conversion for particular learner file format.

Specified by:
toString in interface Learner
Parameters:
data - the data to convert
Returns:
the String representation