|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--ostore.oil.Screen
A model that filters a stream of QuickSerializable
objects. The Screen counts the number of times each of a
specified set of keys occurs in the stream.
Internally HashMaps are used to store the set of
interesting keys. It is therefore not advised to apply this class to
objects whose hashCode or equals methods are
expensive to compute.
This class is synchronized.
Model| Nested Class Summary |
|---|
| Nested classes inherited from class ostore.oil.Model |
|---|
Model.Delta, Model.Prediction |
| Constructor Summary | |
|---|---|
Screen()
Construct a new Screen. |
|
Screen(boolean remember)
Construct a new Screen. |
|
Screen(InputBuffer buffer)
Constructs a Screen from its
serialized form. |
|
| Method Summary | |
|---|---|
void |
add_delta(Model.Delta d)
Incorporate the information from a Delta into this
Model.
|
void |
clear()
Forget all observations recorded since the last call to
clear or recalculate. |
void |
clear(int num)
Forget the least-recent recorded observations. |
int |
get_all_counts()
Returns the current sum of all counts. |
int |
get_count(QuickSerializable key)
Returns the current count for the specified key. |
double |
loglikelihood()
Calculates the log-likelihood of all recorded
observations. |
QuickSerializable[] |
outliers()
Returns the recent observations which the model assigns the lowest likelihood. |
Model.Prediction |
predict(int horizon)
Make a prediction based on current model parameters and observations. |
Model.Delta |
recalculate()
Processes the recent event stream. |
void |
record(QuickSerializable observation)
Records an object from the event stream (does not process). |
void |
record(QuickSerializable[] observations)
Processes a group of objects from the event stream. |
void |
remove_all()
Removes all keys from the screened set. |
void |
remove(QuickSerializable key)
Removes a key from the screened set. |
void |
serialize(OutputBuffer buffer)
Add the object to the buffer. |
int |
total()
Returns the current total count. |
void |
watch(QuickSerializable key)
Adds a key to screened. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Screen()
Screen.
public Screen(InputBuffer buffer)
throws QSException
Screen from its
serialized form.
public Screen(boolean remember)
Screen.
remember - true iff the Screen should
remember the counts for keys that are removed.| Method Detail |
public void watch(QuickSerializable key)
Screen remembers a previous count for the
specified key, that count shall be restored.
key - The object to look for in the stream.public void remove(QuickSerializable key)
Screen has been told to remember old keys, the
key and its current count will be stored for later salvaging.
key - The object to stop looking for.public void remove_all()
Screen has been told to remember old keys, the
keys and their current counts will be stored for later salvaging.
public int get_count(QuickSerializable key)
key - The key whose count to return.
key has been processed.
If the key was never watched, or has since been
forgotten, returns 0.public int get_all_counts()
public int total()
public void record(QuickSerializable observation)
record in interface Modelobservation - The object to recordpublic void record(QuickSerializable[] observations)
record in interface Modelobservations - The objects to recordpublic void clear(int num)
Modelrecorded observations.
clear in interface Modelpublic void clear()
Modelrecorded since the last call to
clear or recalculate.
clear in interface Modelpublic double loglikelihood()
Modelrecorded
observations. Only observations recorded since the last call to
clear or recalculate are considered.
loglikelihood in interface ModelD) given the current
model (M); log(p(D|M)). If no
observations exist, it returns Double.NaN.public Model.Delta recalculate()
recalculate in interface ModelDelta storing the difference between the new
model parameters and the old.public Model.Prediction predict(int horizon)
Model
predict in interface ModelPrediction, whose semantics depends on the
particular subclass of Model.public QuickSerializable[] outliers()
Model
outliers in interface Modelpublic void add_delta(Model.Delta d)
ModelDelta into this
Model.
The resulting Model should be equivalent to that which
produced the Delta, given that they began in the same
state. Subclasses of Model employ specific subclasses
of Delta.
add_delta in interface Modelpublic void serialize(OutputBuffer buffer)
QuickSerializablebuffer.
serialize in interface QuickSerializablebuffer - the output buffer to add the object to
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||