net.siefkes.nlstego.predict
Class PPMFetchStats

java.lang.Object
  extended by net.siefkes.nlstego.predict.FetchStats
      extended by net.siefkes.nlstego.predict.PPMFetchStats
All Implemented Interfaces:
Serializable

public final class PPMFetchStats
extends FetchStats

Implementation of the FetchStats class using a Prediction-by-Partial-Match strategy. This class collects statistics about the item access history that can be used for prediction.

Created (04.10.2001 11:16:19).

Version:
$Revision: 1.14 $, $Date: 2005/07/28 15:03:09 $, $Author: siefkes $
Author:
Christian Siefkes
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.siefkes.nlstego.predict.FetchStats
END_OF_SESSION, START_OF_SESSION
 
Constructor Summary
PPMFetchStats(Configuration conf, StatelessFilter filter)
          Creates a new instance.
 
Method Summary
 void add(String key, int sessionID, boolean train)
          Adds a request of an item.
 int getBlendingNum()
          A standard get*().
 double getDecFactor()
          A standard get*().
 int getInnerCacheSize()
          A standard get*().
 int getLargestOuterCacheSize()
          A standard get*().
 int getLengthOfHistory()
          A standard get*().
 int getMinAccesses()
          A standard get*().
 SortedMap predict(int number, int sessionID)
          Predicts the items that will probably be requested next.
 String printModelStats()
          Prints statistical information about this model.
 void sessionEnded(int sessionID)
          Marks a session as ended.
 String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class net.siefkes.nlstego.predict.FetchStats
add, getID, getIDInteger, getStatelessFilter, mapKey, shutdown, unmapKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PPMFetchStats

public PPMFetchStats(Configuration conf,
                     StatelessFilter filter)
Creates a new instance.

Created (11.09.2001 16:35:54) by Christian Siefkes.

Parameters:
conf - the Configuration to use
filter - optional filter that decides which predictions should be stored in the stateless (global) model; if null, all predictions are stored
Method Detail

add

public void add(String key,
                int sessionID,
                boolean train)
Adds a request of an item.

Created (27.09.2001 12:16:43) by Christian Siefkes.

Specified by:
add in class FetchStats
Parameters:
key - unique ID of the item currently requested fetching the last document in this session
sessionID - the ID of the current session (must be unique among all sessions parallel in progress)
train - true iff the model should be trained, i.e. this request should be incorporated into the prediction model; otherwise only the internal state will be changed so the next call to predict(int, int) will find suitable predictions (this happens in any case)

getBlendingNum

public int getBlendingNum()
A standard get*().

Created (01.10.2001 11:35:12) by Christian Siefkes.

Returns:
the value of the attribute

getDecFactor

public double getDecFactor()
A standard get*().

Created (01.10.2001 11:16:32) by Christian Siefkes.

Returns:
the value of the attribute

getInnerCacheSize

public int getInnerCacheSize()
A standard get*().

Created (01.10.2001 11:16:23) by Christian Siefkes.

Returns:
the value of the attribute

getLargestOuterCacheSize

public int getLargestOuterCacheSize()
A standard get*().

Created (01.10.2001 11:16:13) by Christian Siefkes.

Returns:
the value of the attribute

getLengthOfHistory

public int getLengthOfHistory()
A standard get*().

Created (26.09.2001 17:52:52) by Christian Siefkes.

Returns:
the value of the attribute

getMinAccesses

public int getMinAccesses()
A standard get*().

Created (01.10.2001 11:34:51) by Christian Siefkes.

Returns:
the value of the attribute

predict

public SortedMap predict(int number,
                         int sessionID)
Predicts the items that will probably be requested next.

Created (27.09.2001 12:16:43) by Christian Siefkes.

Specified by:
predict in class FetchStats
Parameters:
number - the number of results to return, >0
sessionID - the ID of the current session (must be unique among all sessions parallel in progress)
Returns:
a SortedMap containing mapped keys as keys and FetchStatsResult's as values. The length of the map is max (number, all matching documents that had at least minAccesses)

printModelStats

public String printModelStats()
Prints statistical information about this model. This method might take some time while the data is gathered.

Specified by:
printModelStats in class FetchStats
Returns:
a string listing statistical details about this model

sessionEnded

public void sessionEnded(int sessionID)
Marks a session as ended.

Created (27.09.2001 12:16:43) by Christian Siefkes.

Specified by:
sessionEnded in class FetchStats
Parameters:
sessionID - the ID of the current session (must be unique among all sessions parallel in progress)

toString

public String toString()
Returns a String that represents the value of this object.

Created (04.10.2001 17:42:12) by Christian Siefkes.

Overrides:
toString in class Object
Returns:
a string representation of the receiver


Copyright © 2003-2005 Christian Siefkes. All Rights Reserved.