Machine Learning from Scratch: Theory of Decision Trees