DEV Community

Cover image for Random Forest
Carlos Almonte
Carlos Almonte

Posted on

Random Forest

This one caught me off guard, 'random forests' what the heck? What does something related to data would be called forest. Then I learned that random forest is nothing but a collection of decision trees, get it? Many trees together... forest, that's some clever name.

A decision tree is when make a decision based on yes/no questions which are answered at each level of the decision tree (example below). Decision trees can be ensembled together so that a goal can be ran through many decision trees in order to improve model score and more accurate predictions.

Example:

Goal: Predict if a person will buy a car.

Questions (splits):
1. Is income > $100K?
 → Yes → next question
 → No → predict “No”
2. Is age < 30?
 → Yes → predict “Yes”
 → No → predict “No”

Top comments (0)