be.unamur.inference.ngram
Class Bigram<T>

java.lang.Object
  extended by be.unamur.inference.ngram.Bigram<T>
Type Parameters:
T - The object type passed to the ObjectKeyGenerator provided at construction time of Bigram object.

public class Bigram<T>
extends Object

This class implements methods to generate a UsageModel from a set of traces. The model is generated using the bigram method, meaning that the probability for each next state only depends on the previous state. Usage of the class should be:

Author:
Xavier Devroey - xavier.devroey@unamur.be

Field Summary
static String END_STATE_ID
           
static String START_STATE_ID
           
 
Constructor Summary
Bigram(ObjectKeyGenerator<T> keyGen)
          Create a new Bigram object.
 
Method Summary
 void addTrace(Iterator<T> trace)
          Add a trace to the bigram.
 be.unamur.transitionsystem.usagemodel.UsageModel getModel()
          Return the model inferred from the given traces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_STATE_ID

public static final String START_STATE_ID
See Also:
Constant Field Values

END_STATE_ID

public static final String END_STATE_ID
See Also:
Constant Field Values
Constructor Detail

Bigram

public Bigram(ObjectKeyGenerator<T> keyGen)
Create a new Bigram object.

Parameters:
keyGen - The key generator used to generate the key corresponding to each trace entry.
Method Detail

addTrace

public void addTrace(Iterator<T> trace)
Add a trace to the bigram. This trace is used to enrich the model.

Parameters:
trace - The trace to add.

getModel

public be.unamur.transitionsystem.usagemodel.UsageModel getModel()
Return the model inferred from the given traces. This method should be called once all the traces have been added to the Bigram instance.

Returns:
The inferred model.


Copyright © 2014 PReCISE, University of Namur. All rights reserved.