- Daily Dose of Data Science
- Posts
- A Typical Thing About Decision Trees Which Many Often Ignore
A Typical Thing About Decision Trees Which Many Often Ignore
Overfitting = Terror!

Although decision trees are simple and intuitive, they always need a bit of extra caution. Here's what you should always remember while training them.
In sklearn's implementation, by default, a decision tree is allowed to grow until all leaves are pure. This leads to overfitting as the model attempts to classify every sample in the training set.
There are various techniques to avoid this, such as pruning and ensembling. Also, make sure that you tune hyperparameters if you use sklearn's implementation.
This was a gentle reminder as many of us often tend to use sklearnโs implementations in their default configuration.
It is always a good practice to know what a default implementation is hiding underneath.
๐ If you liked this post, leave a heart react ๐ค.
๐ If you love reading this newsletter, feel free to share it with friends!
Find the code for my tips here: GitHub.
Reply