ace
Class Trainer

java.lang.Object
  extended by ace.Trainer

public class Trainer
extends java.lang.Object

Trains a Weka Classifier based on a set of Weka training Instances.


Constructor Summary
Trainer()
           
 
Method Summary
static void saveInstancesAsARFF(weka.core.Instances instances, java.lang.String file_path)
          Saves the given Weka Instances as an arff file with the given path.
static void train(weka.core.Instances instances, TrainedModel trained)
          Trains the Weka Classifier contained in the given TrainedModel object based on the given traning Instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trainer

public Trainer()
Method Detail

train

public static void train(weka.core.Instances instances,
                         TrainedModel trained)
                  throws java.lang.Exception
Trains the Weka Classifier contained in the given TrainedModel object based on the given traning Instances.

Parameters:
instances - The Weka Instances to use for training.
trained - The serializeable TrainedModel object containing reference to the Weka object needed for classification.
Throws:
java.lang.Exception - If an errror is encountered.

saveInstancesAsARFF

public static void saveInstancesAsARFF(weka.core.Instances instances,
                                       java.lang.String file_path)
                                throws java.lang.Exception
Saves the given Weka Instances as an arff file with the given path.

Parameters:
instances - The Weka Instances to save.
file_path - The path of the arff file to save.
Throws:
java.lang.Exception - Throws an exception if cannot save the given instances.