Member-only story
Machine Learning 101 P12: Decision tree + random forest in classification task
3 min readFeb 21, 2025
We’ve explored how these algorithms are applied in regression models. If you missed that, here’s the link for reference. Now, let’s shift our focus to how they function in classification tasks.
How Random forest works in classification task (step-by-step)
- Step 1: Pick at random k data points from the training set.
- Step 2: Build the decision tree associated to these k data points.
- Step 3: Choose the number n trees you want to build and repeat step 1 and 2.
- Step 4: For a new data point, make each one of your new n trees predict the category to which the data point belongs, assign the new data point to the category that wins the majority vote.
So the steps should be almost identical to regression task, with the difference lies in the last step, where the average of predictions is taken in regression task.
Need feature scaling?
No, feature scaling is NOT required for Random Forest.
Unlike algorithms such as Logistic Regression, SVM, or KNN, Random Forest is tree-based and does not rely on distances or gradient-based optimization. It simply splits data at…