Machine learning goes beyond Deep Learning and Neural Networks
Sometimes a simpler technique might give you better results and be easier to understand
A very versatile algorithm is the Decision Forest
🌴🌲🌳?
What is it and how does it work?
Let me tell you..
[7 min]
1/10🧵
Before understanding a Forest, let's start by what's a Tree
Imagine you have a table of data of characteristics of Felines. With features like size, weight, color, habitat and a column with the labels like lion, tiger, house cat, lynx and so on.
2/10🧵
With some time, you could write a code based on if/else statements that could, for each a row in the table, decide which feline it is
This is exactly what a Decision Tree does
During its training it creates the if/elses
These if/else statements can vary a lot based on which features are used so completely different trees are possible and with good results
Instead of deciding which one is the best, why not use multiple of them and decide the correct prediction based on all their results?
4/10🧵
Using multiple Decision Trees in a model, or just a group of predictors to get a better aggregate predictor is called an Ensemble method.
More specifically for Decision Trees, there are some well known methods:
• Random Forest
• Gradient-boosted Trees
• CART
5/10🧵
These 🌳 based Ensemble methods have some benefits
• Explainability. You can understand all the decisions (if/else's) they are making
• Work directly on numerical and categorical data without any preprocess
• No need to worry with layers and architectures as in NN
6/10🧵
TensorFlow now also has a Decision Forest as part of the framework
The main advantage is that, being part of the framework, your models interact with all the other tooling available like TF Serving and TFX for example.
This video explains better:
7/10🧵
For even more information about TensorFlow Decision Forests, @random_forest and @mat_gb wrote this great blot post with more in depth information.
TensorFlow Hub has models for all the ML domains such as Image, Text, Audio and Video
For image, this tutorial can get you started with Transfer Learning. It does some cool tricks with the data and the final model is ready for on-device deployment
Sometimes you need to build a Machine Learning model that cannot be expressed with the Sequential API
For these moments, when you need a more complex model, with multiple inputs and outputs or with residual connections, that's when you need the Functional API!
[2.46 min]
1/8🧵
The Functional API is more flexible than the Sequential API.
The easiest way to understand is to visualize the same model created using the Sequential and Functional API
2/8🧵
You can think of the Functional API as a way to create a Directed Acyclic Graph (DAG) of layers while the Sequential API can only create a stack of layers.
Functional is also known as Symbolic or Declarative API