DECISION GRAPH FOR EVENT STREAM DATA

Information

  • Patent Application
  • 20130006915
  • Publication Number
    20130006915
  • Date Filed
    June 29, 2011
    13 years ago
  • Date Published
    January 03, 2013
    11 years ago
Abstract
A method of generating a decision graph from event stream data, wherein the event stream data includes a plurality of events, and each event includes an associated time stamp, includes generating decision nodes for the graph, wherein the decision nodes each comprise a question having a temporal element. The method includes generating leaf nodes for the graph, wherein the leaf nodes each comprise a rate parameter, and iteratively splitting and merging nodes in the graph in order to maximize a measure of purity of outcomes in resulting nodes.
Description
BACKGROUND

The problem of learning temporal dependencies from streams of multivariate discrete events arises in a wide variety of applications. For example, the firing patterns of neurons, gene expression data, file access patterns in operating systems, sales patterns at retailers, browsing patterns on the web, and activity patterns on social networks, can all be viewed as streams of events over time. Events carry both information about their timing and their type (e.g., identity of neuron that fired, customer ID and SKU of sale, file identifier and access type etc.), and the dependencies between events can be on both their timing and their types.


While graphical models such as Bayesian networks and dependency networks are widely used to model the dependencies between variables, they do not directly model time. Dynamic Bayesian Networks (DBNs) allow temporal modeling in discrete time, and Continuous Time Bayesian Networks (CTBNs) model the joint trajectories of discrete valued variables in continuous time. Thus, modeling event streams with DBNs requires choosing a discretization of time, while modeling them with CTBNs requires further modeling assumptions in order to encode event sequences as sequences of state transitions of some set of discrete variables.


SUMMARY

This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.


One embodiment is directed to an algorithm for modeling the dependencies in event stream data, and for visualizing these dependencies, using graphical event models. By modeling these event streams, questions such as “what is the next query this user will issue and when will they issue it?” and “which files will be accessed in the next week?” can be answered using the model. An algorithm is disclosed for building decision graphs that ask questions about events in the past in order to predict the rate at which each type of event is likely to occur in the future.


One embodiment is directed to a method of generating a decision graph from event stream data, wherein the event stream data includes a plurality of events, and each event includes an associated time stamp. The method includes generating decision nodes for the graph, wherein the decision nodes each comprise a question having a temporal element. The method includes generating leaf nodes for the graph, wherein the leaf nodes each comprise a rate parameter, and iteratively splitting and merging nodes in the graph in order to maximize a measure of purity of outcomes in resulting nodes.





BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a further understanding of embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain principles of embodiments. Other embodiments and many of the intended advantages of embodiments will be readily appreciated, as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale relative to each other. Like reference numerals designate corresponding similar parts.



FIG. 1 is a block diagram illustrating a computing environment suitable for implementing aspects of a system for generating and using graphical event models according to one embodiment.



FIG. 2 is a block diagram illustrating a system for generating and using graphical event models to provide prediction data according to one embodiment.



FIG. 3 is a diagram illustrating a decision graph according to one embodiment.



FIG. 4 is a flow diagram illustrating a method of generating a decision graph from event stream data according to one embodiment.



FIG. 5 is a flow diagram illustrating a method for forecasting future events in an event stream according to one embodiment.



FIG. 6 is a graphical model illustrating a generative model according to one embodiment.



FIG. 7 is a diagram illustrating a graphical representation of a model according to one embodiment.





DETAILED DESCRIPTION

In the following Detailed Description, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. It is to be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present invention. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims.


It is to be understood that features of the various exemplary embodiments described herein may be combined with each other, unless specifically noted otherwise.


1. Generating and Using Graphical Event Models to Provide Prediction Data


One embodiment is directed to an algorithm for modeling the dependencies in event stream data, and for visualizing these dependencies, using graphical event models. Examples of event streams include web search logs and system event logs. By modeling these event streams, questions such as “what is the next query this user will issue and when will they issue it?” and “which files will be accessed in the next week?” can be answered using the model. One embodiment is directed to an algorithm for building decision graphs that ask questions about events in the past in order to predict the rate at which each type of event is likely to occur in the future.


A graphical event model according to one embodiment represents temporal dependencies in event streams. In particular, graphical event models describe how events influence each other and the timescales of those influences. Graphical event models can be learned from data, using a closed-form Bayesian approach to learning non-linear temporal dependencies, and probabilistic queries can be answered using Monte Carlo inference techniques. The learning algorithm has been used on both synthetic and real data to recover nonlinear temporal dependencies, and a Monte Carlo inference procedure has been shown to efficiently answer queries on these graphical event models.


In one embodiment, event streams are represented as marked or labeled point processes on the non-negative real line, with discrete labels specifying the types of the events. Graphical event models, which are a class of marked point processes, are generated from the event streams. Graphical event models represent the likelihood of each event given its history using a competing risks representation in terms of crude hazards for each event type. The crude hazard functions can encode arbitrarily complex dependencies on the past, and explicitly model the occurrence of events in time. The competing risks representation allows the dependencies of each event type in the past to be represented in graphical form. It also allows the dependencies of each type of event to be learned independently and in parallel.


A conjugate prior is used for graphical event models whose crude hazards have a piecewise exponential density. This allows for parameter learning and evaluation of the marginal likelihood in closed form. This in turn enables structure learning through a decision graph building procedure yielding decision graph graphical event models. Inference can be carried out using forward sampling for arbitrary finite duration queries for general graphical event models. For the class of queries that specify particular sequences of events in given time intervals, low probability queries are evaluated using importance sampling (e.g., Poisson superposition importance sampling).


The learning and inference procedures described herein have been validated empirically. It has been shown that nonlinear temporal dependency structures can be recovered, including excitatory and inhibitory effects, using a synthetic data set. The Poisson superposition importance sampling has been evaluated in answering probabilistic queries over a model with such nonlinear temporal dependencies. It has also been shown that decision graph graphical event models give predictive and computational gains over Poisson Networks in learning dependencies from real supercomputer event logs. In particular, it has been shown that decision graph graphical event models are able to efficiently model the timing and type of alert messages from a real supercomputer, which is indicative of their value in applications such as predicting failures in datacenters where the timing and the modes of failure are both of interest.



FIG. 1 is a diagram illustrating a computing environment 10 suitable for implementing aspects of a system for generating and using graphical event models according to one embodiment. In the illustrated embodiment, the computing system or computing device 10 includes one or more processing units 12 and system memory 14. Depending on the exact configuration and type of computing device, memory 14 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.), or some combination of the two.


Computing device 10 may also have additional features/functionality. For example, computing device 10 may also include additional storage (removable and/or non-removable) including, but not limited to, magnetic or optical disks or tape. Such additional storage is illustrated in FIG. 1 by removable storage 16 and non-removable storage 18. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any suitable method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Memory 14, removable storage 16 and non-removable storage 18 are all examples of computer storage media (e.g., computer-readable storage media storing computer-executable instructions that when executed by at least one processor cause the at least one processor to perform a method). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by computing device 10. Any such computer storage media may be part of computing device 10.


The various elements of computing device 10 are communicatively coupled together via one or more communication links 15. Computing device 10 also includes one or more communication connections 24 that allow computing device 10 to communicate with other computers/applications 26. Computing device 10 may also include input device(s) 22, such as keyboard, pointing device (e.g., mouse), pen, voice input device, touch input device, etc. Computing device 10 may also include output device(s) 20, such as a display, speakers, printer, etc.



FIG. 1 and the above discussion are intended to provide a brief general description of a suitable computing environment in which one or more embodiments may be implemented. It should be understood, however, that handheld, portable, and other computing devices of all kinds are contemplated for use. FIG. 1 thus illustrates an example of a suitable computing system environment 10 in which the embodiments may be implemented, although as made clear above, the computing system environment 10 is only one example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the embodiments. Neither should the computing environment 10 be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary operating environment 10.



FIG. 2 is a block diagram illustrating a system 200 for generating and using graphical event models to provide prediction data according to one embodiment. System 200 includes a model generation component 204 and a prediction component 208. Model generation component 204 generates a graphical event model 206 based on received input data 202. In one embodiment, the input data 202 is event stream data, such as web search logs or system event logs, with a time associated with each event in the stream. Based on the generated graphical event model 206, prediction component 208 generates prediction data 210 that forecasts future events and times based on past event data.


In the graphical event model 206 according to one embodiment, events of different types are distinguished by labels, l, drawn from a finite alphabet L. An event is then composed of a non-negative time-stamp, t, and a label, l. The graphical event model consists of at least one directed graph, G, over the finite alphabet, L, and a set, Z, of crude hazards indexed by label, l.


In one embodiment, graphical event model 206 includes a plurality of decision graphs (e.g., decision graph 300 shown in FIG. 3 and discussed below), with each individual decision graph in the model 206 corresponding to or representing an event type. In one embodiment, model 206 includes a decision graph for each possible kind of event that might occur. A decision graph according to one embodiment is a directed acyclic graph with exactly one root node. Each non-leaf node has associated with it a question, q, which maps inputs to a finite set of answers. Each such node has a child corresponding to each answer. The state space consists of the leaf nodes of the decision graph which implements the mapping of histories and times to leaf nodes. The set of questions that are considered map histories and times to a finite set of answers.



FIG. 3 is a diagram illustrating a decision graph 300 according to one embodiment. Decision graph includes a plurality of decision nodes 302(1)-302(3) (collectively referred to as decision nodes 302), and a plurality of leaf nodes 304(1)-304(4) (collectively referred to as leaf nodes 304). Each decision node 302 comprises a question. The decision process begins at the top or root decision node 302(1), and the answer (yes or no) to the question at that node 302(1) indicates which node 302 to move to next. For example, if the answer to Question1 at node 302(1) is no, the decision process moves to node, 302(2) to answer Question2, and if the answer to Question1 at node 302(1) is yes, the decision process moves to node 302(3) to answer Question3. The questions in the nodes 302 are answered based on the input data 202 (FIG. 2). At the end of the decision graph 300 are a plurality of leaf nodes 304. In one embodiment, each of the leaf nodes 304(1)-304(4) comprises a speed or rate parameter (e.g., Rate1, Rate2, Rate3, and Rate4, respectively).


Graphical event model 206 (FIG. 2) according to one embodiment is used to simulate races (e.g., like a horse race), and the results of those races provide information about future events that will occur and the timing of those future events. The race participants are the various types of events that might occur. Each such event is represented by a decision graph 300 in the model 206. The rate parameters at the leaf nodes 304 of each decision graph define the speed of the race participant corresponding to that decision graph. The speed of each race participant may vary during any given race. The current speed of a race participant is determined by answering the questions in the nodes 302, until a leaf node 304 is reached that indicates the current rate parameter.


As an example, assume that we want to determine if the next query to be issued by a given user will be a car insurance query. Car insurance queries would be an event type that would be a race participant represented by a decision graph 300 in the model 206. The nodes 302 might include questions such as “has the person queried about car insurance in the last minute (or hour, or day, or week, etc.)”, or “has the person searched for a new or used car in the last month (or other time frame)”. The questions are answered until a leaf node 304 is reached, which defines the current speed for the car insurance query race participant. If the car insurance query race participant wins the race, this indicates that the next query to be issued by the user will be a car insurance query.


Each question in the nodes 302 according to one embodiment includes a temporal element. Thus, when a race participant reaches a particular leaf node 304, and a rate is determined from that node 304, the length of time that the rate is valid can also be determined from the temporal elements of the questions. For example, if one of the questions is “has the user issued a car insurance query in the last seven days”, and the input data 202 indicates that the user issued such a query two days ago, the answer to that question will be yes from now until five days from now.


Using the various rates and the amounts of time that the rates are valid, a race simulation may be run to generate a hypothetical sequence of events that might occur, with each such hypothetical event including an associated time stamp. Thus, the first event in the sequence is the next event that is likely to occur, and the time stamp indicates the time that it is likely to occur.


Given a sequence of events that have already occurred, and their respective time stamps, the model gives a rate for each event type and a period for which it is valid. A hypothetical next event and time stamp is generated from a simulated race as follows: For each event type, a finishing time is simulated. The finishing time is drawn from an exponential distribution with the rate parameter corresponding to the event type. If the drawn finishing type is after the validity period, a new rate and validity period is obtained for that event type using the procedure above. After a valid finishing time is obtained for each event type, the winner with the earliest finishing time is chosen, and is accepted as the next hypothetical event. This event is appended onto the sequence of events that has occurred, and new rates and validity periods are found for each event type, and the race is repeated.


In one embodiment, multiple simulations are performed to determine a probability that a certain event will occur within a given future time frame. For example, assume that the system is attempting to determine whether a certain user will issue a car insurance query in the next week. Multiple simulations, such as 1000 simulations, may be performed for that week, resulting in 1000 hypothetical time-stamped sequences of events. In some of the 1000 sequences, the user may issue a car insurance query, and in other ones of the sequences, the user may not issue a car insurance query. The number of sequences in which the user issued a car insurance query divided by the total number of sequences (1000) gives a probability that the user will actually issue a car insurance query in the next week. This process is referred to as forward sampling.


For some applications, the simulation process may involve more or less than 1000 simulations. Some applications may benefit from 1 million or more simulations. However, larger numbers of simulations can be computationally expensive. One way to avoid this issue is to use importance sampling.


One embodiment estimates the probability that a condition of interest will be met in the future. For example, such a condition might be that a user issues at least ten queries for insurance products in the next week. Another example of such a condition is that an unplanned reboot is preceded by a particular system warning in one to two days from now. Given a known history of events 202, event sequences are sampled from the graphical event model 206 through the window of interest (e.g., a future time window), and the proportion of sequences that meet the conditions to be forecast (e.g., that meet count constraints or order constraints) is determined. This proportion is an estimate of the probability that the condition of interest will be met. Again, this process is referred to as forward sampling.


In one embodiment, a Monte Carlo algorithm is used to estimate the probabilities of a sequence of events occurring in specified time intervals, given a history up to some time. For example, we may wish to know the probability that a computer system will experience a hard disk failure in the next week, or that a user will be shown a particular display ad in the next week and then visit the advertising merchant's website in the next month. In one embodiment, an importance sampling procedure is used for such queries, and a forward sampling procedure is used for arbitrary finite duration queries.


Generating a decision graph 300 for the graphical event model 206 involves a couple of steps. The values for the rates at the leaf nodes 304 are determined, and the set of questions for the decision nodes 302 and the order in which to ask them are determined. Regarding setting the values for the rates, each leaf node 304 corresponds to a particular state. For example, assume that the decision process has gone through a given decision graph 300 and reached a leaf node 304 that indicates that the user has issued a car insurance query in the last minute, and has issued a used car query in the last month. The input data 202 (e.g., search logs) for all users is examined, and it is determined how long each user has been in that state (i.e., the state where the user has issued a car insurance query in the last minute and a used car query in the last month). The process next involves determining how many times they actually issued a car insurance query when they were in that state. This gives a count of how many times the event to be predicted occurred in that state. The process also involves determining how long they were in that state, which allows a rate (e.g., a number of occurrences per second) to be determined.


Regarding the determination of the set of questions and the order in which to ask them portion of the construction of the decision graphs, a set of possible questions are provided. Each of the questions is evaluated using the input data 202, and a question that splits the data 202 into the most dissimilar piles or groups is identified. This process is repeated for each resulting pile or group. The process continues until none of the remaining questions are able to split the data into groups that are sufficiently dissimilar (e.g., that satisfy a dissimilarity threshold).


In one embodiment, a factored structural prior is used, and the space of possible structures is searched as follows. The process begins with a trivial decision graph that maps all histories and times to the root node (e.g., node 302(1)). This yields an exponential crude hazard with no dependencies on any labels. The process then involves iteratively splitting and merging nodes in the graph. A node is split by applying a question to get new nodes. The gain in the posterior of the structure due to the split is calculated. A pair of nodes is merged to a new state, generating a new state space. The gain in the posterior of the structure due to this merge is calculated. The next structure is chosen by updating the current structure by choosing the best split or merge, until there is no gain. In one embodiment, the computation of the gain due to a merge or split depends only on the states being merged or split and their associated parameters.


The dissimilarity measure and the gain measure discussed above according to one embodiment are measures of the purity of outcomes in the resulting nodes of the graphical event model. In one embodiment, the nodes in the graph are split or merged greedily in order to maximize the measure of purity. The measure of purity according to one embodiment is one of a Bayesian score, a likelihood, or a penalized likelihood. In one embodiment, after generating the graphical event model, the model is pruned back via cross-validation.



FIG. 4 is a flow diagram illustrating a method 400 of generating a decision graph from event stream data according to one embodiment. The event stream data in method 400 according to one embodiment includes a plurality of events, and each event includes an associated time stamp. At 402 in method 400, decision nodes for the graph are generated, wherein the decision nodes each comprise a question having a temporal element. At 404, leaf nodes for the graph are generated, wherein the leaf nodes each comprise a rate parameter. At 406, the nodes in the graph are iteratively split and merged in order to maximize a measure of purity of outcomes in resulting nodes. In one embodiment, the decision graph in method 400 is a decision tree.



FIG. 5 is a flow diagram illustrating a method 500 for forecasting future events in an event stream according to one embodiment. The event stream in method 500 according to one embodiment includes a plurality of events, and each event includes an associated time stamp. At 502 in method 500, a decision graph model is provided, including a plurality of decision trees, wherein each decision tree corresponds to one of a plurality of potential future events, wherein each decision tree includes decision nodes comprising a question having a temporal element, and wherein each decision tree includes leaf nodes comprising a rate parameter. At 504, past events in the event stream are analyzed using the decision graph model. At 506, a future event is forecast based on the analysis of past events at 504. In one embodiment of method 500, a type and a time of the future event is determined directly from the decision graph model. The forecasting at 506 according to one embodiment is done by sampling. In one embodiment, the forecasting at 506 is repeated to generate a hypothetical sequence. Then, the number of events of a certain type can be counted or whether a certain order of events (e.g. A then B then C) can be tested based on this hypothetical sequence. This can then be repeated to determine a proportion.


At 508 in method 500, a value representing a number of events of a given type that will occur in a future time window is forecast based on the analysis of past events. At 510, an order in which events will occur in a future time window is forecast based on the analysis of past events. At 512, a plurality of event sequences for a future time window is generated using the decision graph model. At 514, a proportion of the plurality of event sequences that meet a condition of interest is determined. In one embodiment, the proportion at 514 represents an estimate of a probability that the condition of interest will be met. The condition of interest at 514 according to one embodiment is one of a count constraint and an order constraint.


2. Graphical Event Models


In this section, we introduce the class of Graphical Event Models. We assume that events of different types are distinguished by labels l drawn from a finite alphabet L. An event is then composed of a non-negative time-stamp t and a label l. Thus our data is an event stream, which is a sequence custom-character={(ti, li)}i=1n where 0<ti< . . . <tn.


We define the history at time t as






h(t)={(ti, li)|(ti, li)∈custom-character, ti≦t}


and write hi=h(ti−1). By convention t0=0. We define the ending time t(h) of a history h as the time of the last event in h: t(h)=maxcustom-charactert so that t(hi)=ti−1.


A Graphical Event Model (GEM) consists of a directed graph G over L and a set Z of crude hazards indexed by lcustom-characterL. Each crude hazard has a CDF Zl(t|h; θ) and density zl(t|h; θ). The crude hazards define a generative model over D through a competing risks representation, as follows. Given a history him a time tl,i is independently drawn for each label lcustom-characterL from the corresponding crude hazard. The earliest of these times and the corresponding label are selected as (ti, li). To ensure that ti>ti−1=t(hi), the crude hazards must satisfy Zl(t(h)|h)=0. The generative model is illustrated using a graphical model in FIG. 6. Note that it has been shown that under mild regularity conditions, any conditional likelihood p(d, l|h) can be represented through crude hazards.


The resulting likelihood of the event stream factors over labels l as









p
(






θ
)


=




l














p
l

(





θ
)









(
1
)







p
l

(






θ
)


=




i
=
1

n








z
l

(


t
i








h
i

,
θ

)



1
i



(

l
i

)



[

1
-



Z
l

(


t
i






h
i

,
θ

)


]



1
i
c



(

l
i

)













(
2
)







where we have used parametric crude hazards. We write 1χ(·) for the indicator function of a set χ. For convenience, we write






1
·


χ
C



(
·
)






for the indicator of the complement of χ and 1x(·) for the indicator of the singleton {x}.


Define the filtered history [h]K as






custom-character={(t, l)|(t, l)∈h,l∈custom-character}


for custom-charactercustom-character. The directed graph G defines independencies between labels by constraining the crude hazards to respect






z
l(t|h)=zl(t∥h|π(l),t>t(h)),


for all h and t>t(h), where π(l) are the parents of l.


EXAMPLE 1

Suppose we have L={A, B, C}, where zA depends only on occurrences of A in h, zB depends on occurrences of both A and B, and zC depends on occurrences of both B and C. The model can be represented by the graph of FIG. 7.


2.1 Crude Hazards in Intensity Form


We can write Al(t|h) for—log(1−Zl(t|h)) and λl(t|h) for its time derivative








1

1
-


Z
i

(

t



h
)








z
i

(
t



h

)




using the convention







0
0

=
0.




The crude hazard CDF and density can then be written






Z
l(t|h)=1−c−Al(t|h)






z
l(t|h)=λl(t|h)e−Al(t|h).


The per-label likelihood of equation (2) can then be written in terms of the conditional intensity function λl(t|h:θ) and Al(t|H:θ)=∫−∝7λl(τ|h:θ)dτ as










p
i

(






θ
)


=




i
=
1

n








λ
i

(


t
i







h
i

·
θ

)



1
i



(

t
i

)








-


Λ
i

(


t
i






h
i

,
θ

)





.









(
3
)







We note that the terms in equation (3) are the waiting time densities of non-homogeneous Poisson processes whose intensity functions are given by the conditional intensity functions λl(t|h:θ). The graphical structure G imposes the restriction λl(t|h:θ)=λl(t∥h|π(t):θ) for t>t(h) on the conditional intensities. Note that any likelihood that meets these structural assumptions can be represented in the form of equation (3). Some extant models of events can be viewed as specifying likelihoods of this form with further modeling assumptions.


2.2 Piecewise Exponential Gems


We consider the class of models where the conditional intensity function is piecewise constant, so that the crude hazard density is piecewise exponential. We call the resulting GEMs piecewise exponential GEMs. We specify such conditional intensity functions in terms of a piecewise constant state trajectory σl(t|h) taking values in a state space Σl and a set of rate parameters ⊖l={λs}s∈Σl. Writing Sl=(Σl:σl(·|·)) the resulting crude hazard is





σl(t|h,Sl:l)=λσl(t|h)custom-character−Σs∈Σlλsdl(s,t|h)


for t>t*(h) where dl(s, t|h) is the duration that σl(·|h) spent in state s between times t(h) and t. The per-label likelihood can then be written in terms of the number of times cl(s) label l occurs in state s and the duration dl(s) s is active, which are given by








c
i



(
s
)


=




i
=
1

n




1
s



(




σ
i



(


t
i





h
i

)


)




1
i



(

l
i

)








d
l



(
s
)



=




i
=
1

n




d
e

(


t
i





h
i

)












The per-label likelihood in terms of these sufficient statistics is










p
l

(








S
l

,

Θ
l


)


=




u



l













λ
s

Cl


(
s
)








-

λ
s




Cl


(
e
)











(
4
)







We also note that the graphical structure G imposes the restriction σl(t|h)=σl(t∥h|π(l))on the state trajectories. Since any rate function in equation (3) can be arbitrarily well approximated by a piecewise constant one, this representation of the likelihood is nonrestrictive. A special subclass of piecewise exponential GEMs are the exponential GEMs that have σl(t|h)=s(h) for t>t(h), resulting in crude hazards which have exponential densities.


3. Learning Gems


In this section, we discuss techniques for learning GEMs. In particular, we concentrate on learning the structure and parameters of piecewise exponential GEMs, giving a conjugate prior under which the posterior over the parameter and the marginal likelihood can both be computed in closed form. This is not possible in the general case, when the crude hazards are not piecewise exponential. The difficulty is that the data only contains truncated observations from zl(t|h,θ) for l≠li.


In section 3.1, we give a prior distribution over the parameter that allows closed form parameter learning, and show how this also gives a closed form expression for the marginal likelihood. In section 3.2, we show how this can be used in a procedure for learning model structure using decision graphs.


3.1 Closed Form Parameter Learning and Marginal Likelihood


Recall that given the structure Si the per-label likelihood for piecewise exponential GEMs given in equation (4) factors into a product of per-state likelihoods λscl(s)e−λ−sdl(s) where the count cl(s) and the duration dl(s) are sufficient statistics for λs. We note that the Gamma distribution is a conjugate prior for λs in this per-label likelihood. The prior density is given by






p
(



λ
s






α
s

,

β
s


)


=



β
s

α
s



Γ


(

α
s

)





λ
s


α
s

-
1




c


-

β
e




λ
e









Multiplying by the likelihood and normalizing gives






custom-characterxs, βs, custom-character)∝λsαs+cl(a)−1e−(βs+dl(s))λs=custom-characterss+cl(s), βs+dl(s))


In addition, assuming that custom-character(⊖l|Sl)=Πs∈Σlcustom-characterxs, βs) the marginal likelihood of the data is







p
l

(








S
l

)


=




s



l












γ
l



,

s






γ
l


,

s
=



β
s

α
s



Γ


(

α
s

)






Γ


(


a
s

+


c
l



(
s
)



)




(


β
s

+


d
l



(
s
)



)



α
s

+


c
l



(
s
)












We use this expression for the marginal likelihood in building decision graphs to learn the model structure Sl.


3.2 Structure Learning with Decision Graphs


In general, the space of possible structures (i.e. all possible state trajectories for all possible histories) is infinite. Modeling assumptions are needed to constrain the structures explored and devise a strategy for searching for a structure in this space. We map histories to state trajectories through decision graphs, and describe a greedy procedure for building such decision graphs. We refer to the resulting GEMs as Decision Graph GEMs (DG-GEMs).


A decision graph is a directed acyclic graph with exactly one root node. Each non-leaf node has associated with it a question q which maps inputs to a finite set {1, . . . , mq} of answers. Each such node has a child corresponding to each answer. In our case the state space Σl will consist of the leaves of a decision graph which implements the mapping σl(t|h) of histories and times to leaves. The set of questions custom-character={q(t|h)} we consider will map histories and times to a finite set {1, . . . , mq} of answers, and are constrained so that the answer trajectory q(t|h) is a piecewise constant function of t for each h. This ensures that σl(t|h) is a valid piecewise constant state trajectory.


For example, given a label l′ ∈h, two times d1<d2, and a thresholdτ, whether or not the count of l′ in h exceeds τin the time window [t−d2, t−dl) is such a question with two possible answers.


We use a factored structural prior custom-character(Sl)∝Πs∈SlNs and search the space of possible structures as follows. We begin with the trivial decision graph that maps all histories and times to the root. This yields an exponential crude hazard with no dependencies on any labels. We then iteratively split and merge leaves in our graph. We split a leaf s∈Sl by applying a question q∈custom-character, to get mq new leaves sl, . . . , smq. The new state space is S′l=(Sl−{s})∪{sl, . . . smq}′. The gain in the posterior of the structure due to this split is













Gain


(


s


s
1


,





,

s

m
q



)


=




p
(


S






)




p
(

S




)










=







j
=
1


m
q










κ






l
,

s
j






γ






l
,

s
j








κ






l
,

s
j






γ






l
,

s
j












(
5
)







A pair of leaves s1.s2 ∈ Sl are merged to a new state s, generating a new state space S′l=(Sl−{S1.S2.})∪{s}.


The gain in the posterior of the structure due to this merge is













Gain


(


s
1

,


s
2


s


)


=




p
(


S






)




p
(

S




)










=











κ






l
,
s





γ






l
,
s








κ






l
,

s
1






γ






l
,

s
1




+



κ






l
,

s
2






γ






l
,

s
2













(
6
)







The next structure S′l is chosen by updating the current structure Sl by choosing the best split or merge, until there is no gain. As seen in equations (5) and (6), the computation of the gain due to a merge or split depends only on the states being merged or split and their associated parameters. In particular, ifs is split into sl, . . . , sm or sl, . . . , sm are merged into s, cx(l)=Σk=1mcsk(l) and ds(l)=Σk=1mdsk(l).


Remark 1. Given a partitioned label space custom-character=∪j=1kcustom-characterj as in example 3, let the candidate question set custom-character={qj}j=1k where qj(t|h) gives the last member of Lj in h. Building a DG-GEM with these candidate questions allows us to learn a CTBN with both local and global structure as has been done for Bayes nets.


4. Inference


In this section we describe Monte Carlo algorithms to estimate the probabilities of a sequence of labels occurring in specified time intervals, given a history up to some time. For example, we may wish to know the probability that a computer system will experience a hard disk failure in the next week, or that a user will be shown a particular display ad in the next week and then visit the advertising merchant's website in the next month. Exact answers to such queries cannot be computed efficiently in general because the probability of events of interest can depend on arbitrary numbers of intervening events. We first present a forward sampling procedure for arbitrary finite duration queries, and then present an importance sampling scheme for queries of the form described above.


4.1 Forward Sampling


We wish to approximate the conditional probability of sequences Dh extending history h satisfying some property E. We assume E is defined as a set of sequences D, and that there is some finishing time tE such that lE(D) can be computed from {(ti, li)∈custom-character: ti≦tE}. This allows us to sample finite continuations Dh of h up to time tE in order to estimate p(E|h). Note that if the model is explosive so that text missing or illegible when filed with non-zero probability, forward sampling can fail. If we sample M extensions custom-character{h(m)}m=1M of h we can estimate the conditional probability p(E|h) of E being satisfied using








p
^

Fwd

(


E




h
;
M

)


=


1
M






m
=
1

M




1
E



(



(
m
)


)









By Hoefding's inequality, P(|{circumflex over (p)}Fwd(E|h; M)−custom-character(E|h)|>ε)≦2text missing or illegible when filed. Thus, the error in


{circumflex over (p)}Fwd(E|h; M) falls as O(l/√{square root over (M)}).


We sample Dh using a generalization of a CTBN forward sampling approach to general GEMs. The graph structure of GEMs implies that we need only sample labels l that E directly depends on and their ancestors, since E does not depend on the other labels. We restrict attention to only these labels. Pseudo Code Example I gives an algorithm ForwardSample(h, t) for forward sampling an extension of a history h up to time t. The estimator {circumflex over (p)}Fwd(E|h: M) samples drawn using D(m)=ForwardSample(h, tE).


PSEUDO CODE EXAMPLE I












Algorithm 1 FORWARDSAMPLE(h,t)

















for all l do



 tl ← zl(·|h)



end for



loop



 l* ← arg min tl.



 t* ← tl.



 if t* > t then



  return h



 end if



 h ← h ∪ {(t*,l*)}



 tl* ← zl(·|h)



 for all children l of l* do



  tl ← zl(·|h)



 end for



end loop










In the case of piecewise exponential hazards, sampling from zl(·|h) can be done by first sampling from the first piece, and if the sampled time is greater than the first boundary, then sampling from the next piece, and so on. A time savings is possible in this case by using lazy evaluation. Instead of sampling from zl(·|h) in the algorithm in Pseudo Code Example 1, a sample is drawn from the first piece of zl(·|h). The sampled time is truncated to the boundary of that piece, and a flag is stored indicating whether or not the time was actually truncated. The truncation flag corresponding to the minimum time is checked after the minimization step, and if it was truncated, a replacement is drawn from the next piece of zl(t|h) and truncated, and the minimization repeated.


4.2 Importance Sampling


When we are interested in the probability of an unlikely event, most of our samples lie outside E, and our estimate of p(E|h) will be noisy.


Since absolute error in {circumflex over (p)}Fwd falls quadratically, we need O(1/p(E|h)2) samples to get useful estimates. In practice, this problem can be mitigated by using importance sampling, where sequences are drawn from a proposal distribution other than the model and weighted to account for this difference. The proposal distribution is chosen to generate samples satisfying E more frequently. Thus, we will sample custom-characterk(m) from our proposal distribution q(Dh) instead of p(Dh|h), and will estimate p(E|h) through







p
Imp

(


E




h
;
M

)


=


1




m
=
1

M



w

(
m
)









m
=
1

M




w

(
m
)




1
E



(



(
m
)


)









where







w

(
m
)


=


p
(



h

(
m
)





h
)




q


(


h

(
m
)


)







We give a proposal distribution for events E specified by a set of ordered constraints C={(ljC,|ajC, bjC|)}j−1k with bj−1C<bjC. Sequences custom-character∈ E must contain the labels ljC in the specified order and in the specified intervals. That is,






E
C={custom-character|∃il< . . . <ik:lij=ljC.tij∈[d jC.bjC].


We sample proposals Dh using a Poisson Superposition Importance Sampler. We will forward sample Dh from our model, but in each interval [ajC.bjC] we will sample an additional event with label lj.hu C and time tjC from an auxiliary Poisson process with intensity λj(t|aj).λj(t|aj)is chosen so that λj(t|a)=0 for t<a. The additional event is rejected outright if it is after bjC. It is only accepted if no events with label ljC are generated by the model in the interval [aj.tjC]. Note that in order to get a correct importance sampler, the auxiliary process must have support after bjC to ensure that we sometimes sample sequences from the model. In our experiments, we use λj(t|aj)=1/(bjC−aj) for t>aj.


The starting time aj for the auxiliary process is typically ajC, but in the case of overlapping intervals, it is adjusted to ensure that only one auxiliary process is running at any time. Since at most one event with label ljC from the auxiliary process is used, it is active only until bj, which is the time of the first occurrence of ljC in [aj, bjC],no such event. Using the Poisson superposition property, we can write the corresponding importance weight as






w
=




j
=
1


k
c









1



-


Λ
j

(


b
j





a
j

)












i
;


l
1

=

b
j






l
1

=

l
j
C







λ

l
j
C


(


t
i





h
i

)





λ

l
j
C


(



t
i





h
i

)


+


λ
j

(


t
i





a
i

)













where Aj(b|a)=∫abλj(t|a)dt. By definition, the second product has at most one term.


Note that w has kC terms corresponding to the kC constraints, which is independent of the number of events sampled. This contrasts with a previous importance sampling scheme for CTBNs, where an arbitrary number of forcing terms can occur in each weight. Thus, we do not experience the problem of degenerate weights, and do not need to resort to particle filtering.


The resulting importance weights and samples are generated using the algorithm given in Pseudo Code Example II by (w(m),D(m))=IMPORTANCESAMPLE(h, {(l*j, aj, bj)}i=1k).


PSEUDO CODE EXAMPLE II














Algorithm 2 IMPORTANCESAMPLE(h.C)








w ← 1



for j = 1, . . . , kC do



 a ← max{ajC, t(h)}



 b ← bjC



 t ← λj(text missing or illegible when filed |a)e−Λj(t|a)



 (h, λ) ← FORCING FORWARDSAMPLEC(h, a , bjC, t, ljC)



 i ← |h|



 if li = ljC then






  
ww×λλ+??indicates text missing or illegible when filed







  b ← ti



 end if







ww×1??indicates text missing or illegible when filed







end for



return (w, h)






text missing or illegible when filed indicates data missing or illegible when filed







The subroutine ForcingForwardSample(h, a, b, t, l) is a version of ForwardSample(h, b) that generates samples conditioned on h after a. ForcingForward-Sample terminates if an event of type l is generated. If t<b and forward sampling does not yield an event of type l before time t, ForcingForwardSample forces the event (t, l) and terminates. In both of these cases, it returns the intensity λl(·|h) at that time. ForcingForwardSample terminates at time b if an event of type l is not produced.


Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that a variety of alternate and/or equivalent implementations may be substituted for the specific embodiments shown and described without departing from the scope of the present invention. This application is intended to cover any adaptations or variations of the specific embodiments discussed herein. Therefore, it is intended that this invention be limited only by the claims and the equivalents thereof.

Claims
  • 1. A method of generating a decision graph from event stream data, wherein the event stream data includes a plurality of events, and each event includes an associated time stamp, the method comprising: generating decision nodes for the graph, wherein the decision nodes each comprise a question having a temporal element;generating leaf nodes for the graph, wherein the leaf nodes each comprise a rate parameter; anditeratively splitting and merging nodes in the graph in order to maximize a measure of purity of outcomes in resulting nodes.
  • 2. The method of claim 1, wherein the decision graph is a decision tree.
  • 3. The method of claim 1, wherein the nodes in the graph are split or merged greedily in order to maximize the measure of purity.
  • 4. The method of claim 3, wherein the measure of purity is a Bayesian score.
  • 5. The method of claim 3, wherein the measure of purity is a likelihood.
  • 6. The method of claim 3, wherein the measure of purity is a penalized likelihood.
  • 7. The method of claim 1, and further comprising: after generating the decision graph, pruning back the generated decision graph.
  • 8. The method of claim 7, where the pruning is done via cross-validation.
  • 9. A computer-readable storage medium storing computer-executable instructions that when executed by at least one processor cause the at least one processor to perform a method of generating a decision tree from event stream data, wherein the event stream data includes a plurality of events, and each event includes an associated time stamp, the method comprising: generating decision nodes for the tree, wherein the decision nodes each comprise a question having a temporal element;generating leaf nodes for the tree, wherein the leaf nodes each comprise a rate parameter; anditeratively splitting and merging nodes in the tree in order to maximize a measure of purity of outcomes in resulting nodes.
  • 10. The computer-readable storage medium of claim 9, wherein the nodes in the tree are split or merged greedily in order to maximize the measure of purity.
  • 11. The computer-readable storage medium of claim 9, wherein the measure of purity is one of a Bayesian score, a likelihood, and a penalized likelihood.
  • 12. A method for forecasting future events in an event stream, wherein the event stream includes a plurality of events, and each event includes an associated time stamp, the method comprising: providing a decision graph model including a plurality of decision trees, wherein each decision tree corresponds to one of a plurality of potential future events, wherein each decision tree includes decision nodes comprising a question having a temporal element, and wherein each decision tree includes leaf nodes comprising a rate parameter;analyzing past events in the event stream using the decision graph model; andforecasting a future event based on the analysis of past events.
  • 13. The method of claim 12, wherein a type of the future event is determined directly from the decision graph model.
  • 14. The method of claim 12, wherein a time of the future event is determined directly from the decision graph model.
  • 15. The method of claim 12, where the forecasting is done by sampling.
  • 16. The method of claim 12, and further comprising: forecasting a value representing a number of events of a given type that will occur in a future time window based on the analysis of past events.
  • 17. The method of claim 12, and further comprising: forecasting an order in which events will occur in a future time window based on the analysis of past events.
  • 18. The method of claim 12, and further comprising: generate a plurality of event sequences for a future time window using the decision graph model; anddetermine a proportion of the plurality of event sequences that meet a condition of interest.
  • 19. The method of claim 18, wherein the proportion represents an estimate of a probability that the condition of interest will be met.
  • 20. The method of claim 19, wherein the condition of interest is one of a count constraint and an order constraint.