struct.alg
Class Predictor

java.lang.Object
  extended by struct.alg.Predictor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ClassificationPredictor, SequencePredictor

public abstract class Predictor
extends java.lang.Object
implements java.io.Serializable

The predictor which predicts targets of instances.

Version:
08/15/2006
See Also:
Serialized Form

Field Summary
 double[] avg_weights
           
 double[] weights
           
 
Constructor Summary
Predictor(int dimensions)
           
 
Method Summary
 void averageWeights(int factor)
          Averages the weights.
abstract  Prediction decode(SLInstance inst, Features feats)
          Predicts for an instance and its features.
abstract  Prediction decode(SLInstance inst, Features feats, int K)
          Predicts for an instance and its features based on K-best.
abstract  void grow(int newSize)
          Grows this predictor to make it ready for training with additional features.
 double score(SLFeatureVector fv)
          Computes the score of the SLFeatureVector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

weights

public double[] weights

avg_weights

public double[] avg_weights
Constructor Detail

Predictor

public Predictor(int dimensions)
Parameters:
dimensions - - the number of features
Method Detail

averageWeights

public void averageWeights(int factor)
Averages the weights.


score

public double score(SLFeatureVector fv)
Computes the score of the SLFeatureVector


decode

public abstract Prediction decode(SLInstance inst,
                                  Features feats)
Predicts for an instance and its features.


decode

public abstract Prediction decode(SLInstance inst,
                                  Features feats,
                                  int K)
Predicts for an instance and its features based on K-best.


grow

public abstract void grow(int newSize)
Grows this predictor to make it ready for training with additional features.

Parameters:
newSize - - the new number of features


Copyright (C) 2006 University of Pennsylvania.