1. A method to predict a failure, the method comprising: incorporating class information indicating whether each of a plurality of example message sequences represents a failure into a Bi-directional extension (BIDE) algorithm to generate a discriminative BIDE (BIDE-discriminative) algorithm; using the BIDE-discriminative algorithm to output a single pattern from the message sequences; building a decision tree to predict a failure based on the single pattern; and determining whether a new message sequence will cause failure using the decision tree.