Decision forests in TensorFlow

Ibrahim Olagoke
2 min readNov 9, 2022

--

Machine learning extends beyond Deep Learning and Neural Networks.

A less complicated method may occasionally produce superior outcomes and be simpler to grasp.

The Decision Forest is a highly flexible algorithm.

What does it do and how does it function?

Let’s start by defining a tree before we can understand a forest.

Consider a table of data listing the characteristics of Cat Breeds. With features such as; Body type, Hair Type, color, and a column with names like Persian Cats, Sphynx Cats, Devon Rex Cats, and so forth.

If you had enough time, you could create a piece of code based on if/else statements that would determine which cat breed belongs to each row in the table.

Exactly, this is what a decision tree accomplishes.

When training, it develops the if/else statements.

Depending on the characteristics utilized, these if/else statements might change significantly, making it feasible to create completely different trees with successful outcomes.

Instead of picking which one is the best, why not utilize several of them and base your prediction on the results of all of them?

The ensemble approach refers to the use of multiple Decision Trees in a model or simply a group of predictors to produce a superior aggregate predictor.

There are a few well-known techniques more specifically for Decision Trees:

Random Forest, Gradient-boosted Trees, and CART

These ensemble-based approaches have some advantages.

• Explicitness, you can interact directly with numerical and categorical data without any preprocessing, and you can comprehend all of their decisions (if/ else’s). Cool, right?

• No need to be concerned about layers and architectures as in NN.

TensorFlow has a Decision Forest in its framework.

The key benefit is that since your models are a part of the framework, they can interact with all the other technology that is provided, such as TF Serving and TFX.

Understanding additional tools and algorithms can make your life easier because machine learning is more than just neural networks.

Decision Trees are more easily understood and, in certain instances, superior to NN!

Please share this topic if you found it helpful so that more people can benefit.

Resources to learn:

1. https://www.youtube.com/watch?v=5qgk9QJ4rdQ

2. https://blog.tensorflow.org/2021/05/introducing-tensorflow-decision-forests.html?m=1

3. https://www.tensorflow.org/decision_forests/tutorials/beginner_colab

--

--

Ibrahim Olagoke
Ibrahim Olagoke

Written by Ibrahim Olagoke

Software Engineer | Machine Learning and AI | TensorFlow Ibadan Lead

No responses yet