Code for learning decision tree