1. A method comprising: receiving historical information of episodes, each episode including at least one sequence of events taken over a period of time; constructing event sets from the historical information, each of the event sets including at least one sequence of events; categorizing each event from the historical information with general event category labels and synthetic event category labels; learning an event metric on the events by using the general event category labels and synthetic event category labels to perform dimensionality reduction to associate a vector with each event and to determine an angle between every two vectors; determining an event set metric using distances between each pair of event sets using the event metric; deriving a sequence metric on the episodes to compute distances between episodes, the sequence metric obtaining a preferred match between two episodes with respect to a cost function describing a weighting for the event set metric; deriving a subsequence metric on the episodes to compute distances between episodes, the subsequence metric is a function of the event set metric on subsequences of each episode; grouping episodes into subgroups based on distances obtained using the sequence metric and the subsequence metric; for at least one subgroup, generating a consensus sequence by finding a preferred sequence of events with respect to a function of the sequence metric and the subsequence metric between the preferred sequence and the episodes of the subgroup; and generating a report indicating the consensus sequence.