weka.classifiers.evaluation
Class EvaluationUtils

public class EvaluationUtils
Contains utility functions for generating lists of predictions in various manners.
Version:
$Revision: 1.8 $
Author:
Len Trigg (len@reeltwo.com)
Field Detail

m_Seed

private int m_Seed
Seed used to randomize data in cross-validation

Method Detail

setSeed

public void setSeed(int seed)
Sets the seed for randomization during cross-validation

getSeed

public int getSeed()
Gets the seed for randomization during cross-validation

getCVPredictions

public weka.core.FastVector getCVPredictions(weka.classifiers.Classifier classifier,
                                             weka.core.Instances data,
                                             int numFolds)
Generate a bunch of predictions ready for processing, by performing a cross-validation on the supplied dataset.
Parameters:
classifier - the Classifier to evaluate
data - the dataset
numFolds - the number of folds in the cross-validation.
Throws:
Exception - if an error occurs

getTrainTestPredictions

public weka.core.FastVector getTrainTestPredictions(weka.classifiers.Classifier classifier,
                                                    weka.core.Instances train,
                                                    weka.core.Instances test)
Generate a bunch of predictions ready for processing, by performing a evaluation on a test set after training on the given training set.
Parameters:
classifier - the Classifier to evaluate
train - the training dataset
test - the test dataset
Throws:
Exception - if an error occurs

getTestPredictions

public weka.core.FastVector getTestPredictions(weka.classifiers.Classifier classifier,
                                               weka.core.Instances test)
Generate a bunch of predictions ready for processing, by performing a evaluation on a test set assuming the classifier is already trained.
Parameters:
classifier - the pre-trained Classifier to evaluate
test - the test dataset
Throws:
Exception - if an error occurs

getPrediction

public weka.classifiers.evaluation.Prediction getPrediction(weka.classifiers.Classifier classifier,
                                                            weka.core.Instance test)
Generate a single prediction for a test instance given the pre-trained classifier.
Parameters:
classifier - the pre-trained Classifier to evaluate
test - the test instance
Throws:
Exception - if an error occurs