CSE 519: Data Science
Steven Skiena
Stony Brook University
Lecture 21: Decision Trees and Boosting
The Machine Learning Zoo
The variety of clever machine learning algorithms makes it easy to lose sight of why?
Evaluation dimensions include:
Subjective Rankings
I asked knowledgeable people to compare these ML methods by these dimensions:
Take Home Lessons
The no free lunch theorem states that no single method works best in all cases.
XOR and Linear Classifiers
Linear classifiers cannot be used to fit simple non-linear functions like eXclusive OR.
More powerful methods are needed, including:
XOR and Decision Trees
Decision Tree Classifiers
Each row/instance travels a unique root-to-leaf path to classification.
The tree partitions the training examples into groups of relatively uniform composition, where the decision becomes easy.
Reducing each training example to its own leaf node implies over training.
Class Logic-Based Explanations? (Projects)
Advantages of Decision Trees
Biggest disadvantage is lack of elegance/Math.
Constructing Decision Trees
Trees are constructed in a top-down manner.
Seek a split along one feature/dimension to purify the information over m classes.
Thus tradeoffs between speed and robustness.
Information-Theoretic Entropy
Entropy measures the amount of class confusion:
Split Criteria
The value of a potential split S is how much it reduces the entropy of the system:
Look Ahead and Decision Trees
Finding the best XOR tree requires look ahead, as it cannot be found by greedy:
Optimal Decision Trees
Finding the minimum height decision tree is NP-complete.
The greedy heuristic approximates the minimum height decision tree to a log(n)-factor.
Stopping Criteria
Building a tree until each leaf is pure (f=1) likely ends with singleton elements, and is overfit.
Decision tree construction is hacking, not science.
Comparison with KNN
Decision trees win when:
KNN wins when:
Ensembles of Decision Trees
We can construct hundreds of decision trees by randomly selecting the feature to split on.
But should all trees get equal votes?
1 Tree vs. 100
Smoother boundary with
Bagged trees.
Voting Classifiers
The natural way to use multiple classifiers gives each a vote, and takes the majority label.
Such aggregation is typically done for random sets of decision trees, or even single features.
But should each classifier get the same vote?
Epicurus’ Principle: ``Keep all theories that are consistent with the data’’. But not equal votes..
Weighing Better Classifiers More
Might weigh by accuracy or linear regression.
But better means getting the hard cases right...
Boosting
Boost weak (but >0.5 accuracy) classifiers in a strong classifier.
To set the weights of the classifier, we will adjust the weights of the training examples.
Easy training examples will be properly classified by most classifiers: we reward classifiers more for getting the hard cases right.
Adaboost in Action
We seek non-linear classifiers using thresholded features as classifiers (e.g x>1)
Initially all points are of equal weight.
Boosting Misclassified Points
The weight of the misclassified points is boosted to make them more important in the next round.
Normalize total weights to sum to 1.
The weight of the new classifier depends upon how accurate it is:
AdaBoost Algorithm
Final Classifier
This weighted ensemble correctly classifies all points.
Boosting: Pro and Con
Boosting provides a way to take advantage of weak classifiers (small correlation features) in an effective way.
Boosting tries to fit every example, thus it will overfit noisy data. “Hard cases make bad law.”
Gradient boosted decision trees are the most common method in Kaggle competitions.