Inducing a hierarchy for multi-class classification problems