struct.sequence
Class SequencePredictor

java.lang.Object
  extended by struct.alg.Predictor
      extended by struct.sequence.SequencePredictor
All Implemented Interfaces:
java.io.Serializable

public class SequencePredictor
extends Predictor

A predictor for sequences.

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

Nested Class Summary
private  class SequencePredictor.KBestSequence
          KBestSequence.
private  class SequencePredictor.SequenceItem
          Item for a sequence.
 
Field Summary
private  boolean disalowIntoStart
           
private static java.util.logging.Logger logger
           
private static long serialVersionUID
           
 
Fields inherited from class struct.alg.Predictor
avg_weights, weights
 
Constructor Summary
SequencePredictor(int dimensions)
           
SequencePredictor(int dimensions, boolean disalowIntoStart)
           
 
Method Summary
 SequencePrediction decode(SLInstance inst, Features feats)
          Predicts for an instance and its features.
 SequencePrediction decode(SLInstance inst, Features feats, int K)
          Predicts for an instance and its features based on K-best.
 void grow(int newSize)
          Grows this predictor to make it ready for training with additional features.
 void loadModel(java.lang.String file)
           
 void saveModel(java.lang.String file)
           
 
Methods inherited from class struct.alg.Predictor
averageWeights, score
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

logger

private static java.util.logging.Logger logger

disalowIntoStart

private boolean disalowIntoStart
Constructor Detail

SequencePredictor

public SequencePredictor(int dimensions)
Parameters:
dimensions - The number of features

SequencePredictor

public SequencePredictor(int dimensions,
                         boolean disalowIntoStart)
Parameters:
dimensions - The number of features
Method Detail

saveModel

public void saveModel(java.lang.String file)
               throws java.lang.Exception
Throws:
java.lang.Exception

loadModel

public void loadModel(java.lang.String file)
               throws java.lang.Exception
Throws:
java.lang.Exception

decode

public SequencePrediction decode(SLInstance inst,
                                 Features feats)
Description copied from class: Predictor
Predicts for an instance and its features.

Specified by:
decode in class Predictor

decode

public SequencePrediction decode(SLInstance inst,
                                 Features feats,
                                 int K)
Description copied from class: Predictor
Predicts for an instance and its features based on K-best.

Specified by:
decode in class Predictor

grow

public void grow(int newSize)
Description copied from class: Predictor
Grows this predictor to make it ready for training with additional features.

Specified by:
grow in class Predictor
Parameters:
newSize - - the new number of features


Copyright (C) 2006 University of Pennsylvania.