struct.alg
Class OnlineLearner

java.lang.Object
  extended by struct.alg.OnlineLearner
All Implemented Interfaces:
StructuredLearner

public class OnlineLearner
extends java.lang.Object
implements StructuredLearner

Learner to train the predictor with instances.

Version:
08/15/2006

Field Summary
private  boolean _averaging
           
private static java.util.logging.Logger logger
           
 
Constructor Summary
OnlineLearner()
          Averaging on by default.
OnlineLearner(boolean averaging)
           
 
Method Summary
 void train(SLInstance[] training, OnlineUpdator updator, Predictor predictor, int numIters)
          Trains the predictor with the given parameters.
 void trainAndEvaluate(SLInstance[] training, SLInstance[] testing, OnlineUpdator update, Predictor predictor, int numIters, SLEvaluator eval)
          Trains the predictor with the given parameters and evaluates its performance.
 void trainAndEvaluate(SLInstance[] training, SLInstance[] testing, OnlineUpdator update, Predictor predictor, int numIters, SLEvaluator eval, boolean avgParams)
          Trains the predictor with the given parameters and evaluates its performance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static java.util.logging.Logger logger

_averaging

private boolean _averaging
Constructor Detail

OnlineLearner

public OnlineLearner()
Averaging on by default.


OnlineLearner

public OnlineLearner(boolean averaging)
Parameters:
averaging - - Set averaging.
Method Detail

train

public void train(SLInstance[] training,
                  OnlineUpdator updator,
                  Predictor predictor,
                  int numIters)
           throws java.io.IOException
Trains the predictor with the given parameters.

Throws:
java.io.IOException

trainAndEvaluate

public void trainAndEvaluate(SLInstance[] training,
                             SLInstance[] testing,
                             OnlineUpdator update,
                             Predictor predictor,
                             int numIters,
                             SLEvaluator eval)
                      throws java.io.IOException
Trains the predictor with the given parameters and evaluates its performance. Always averages parameters.

Throws:
java.io.IOException

trainAndEvaluate

public void trainAndEvaluate(SLInstance[] training,
                             SLInstance[] testing,
                             OnlineUpdator update,
                             Predictor predictor,
                             int numIters,
                             SLEvaluator eval,
                             boolean avgParams)
                      throws java.io.IOException
Trains the predictor with the given parameters and evaluates its performance.

Throws:
java.io.IOException


Copyright (C) 2006 University of Pennsylvania.