1. A computer-implemented method comprising: monitoring a stream of events occurring at an apparatus, each event being associated with a plurality of features describing the event, at least some of the plurality of features being related in a hierarchical manner; creating a graphical data structure comprising variable nodes connected by edges, the plurality of features describing the event being represented by variable nodes and the variable nodes being connected such that sequences of connected variable nodes represent the hierarchical relations between features, each variable node being associated with statistics describing a probability distribution representing a latent event score; arranging a training engine to update the statistics for at least one of the variable nodes on the basis of the monitoring; and predicting an event using the graphical data structure.