Facebook Pixel Code

This is the sixth article in a series dedicated to the various aspects of machine learning. Today’s article will break types of algorithms used in machine learning, offering insight into the various ways that ML agents make use of data. 

Our previous article on the machine learning cycle stressed the importance of algorithms to the development, training, and deployment of an ML agent. An algorithm is a set of instructions for the agent that touch on how to interact with, manipulate, and transform data to reach the desired solution, and some agents require multiple, even several algorithms to perform a task. 

The last article’s example of an ML agent was R2, Dominos’ four-wheel delivery robot, and its algorithms were primarily concerned with making sense of the environment as it encounters it in real-time, along with making predictions as to how that environment can change.

We understand that just saying “algorithms,” even with our working definition given above, can make their role and importance still a little hazy to a reader. What we’ll be doing below is give you a rundown of a few types of algorithms a ML agent could be expected to use. 


Bayesian Algorithms


This type of algorithm is named after Thomas Bayes, a mathematician known for his work on conditional probability, which deals with decision-making based on previous outcomes. Bayes Theorem is his legacy, which is a formula for calculating conditional probability. 

Bayesian algorithms, then, are all about probabilistic reasoning about what is known beforehand, or from the past. These algorithms allow engineers to give an ML agent information, such as beliefs and what models ought to resemble, without consultation to any data. So, R2 the delivery bot can know what cars can look like, and to know without experience that it should avoid getting in the way of a moving car. 


Clustering Algorithms


If you’ve been keeping up with this series, you’ll know about the practice of clustering by now, wherein an AI agent groups portions of unlabeled/unstructured data into “clusters” based on observed similarities between them. In a word, it is a method for an agent to make sense of that which it does not understand. 


What you may not know is that the act of clustering depends on algorithms. What clustering algorithms do is analyze objects to discover parameters similar amongst them, then make a decision which ones deserve to be clustered and which do not. 


There are a few different types of clustering, listed below.


  • Centroid-based
  • Hierarchical-based
  • Density-based
  • Distribution-based


We’ll detail the lengthy explanations of each in a later article, but the thing to know here is that clustering can actually be quite a complex activity, involving more than just grouping, say, animal pictures together based on the color of the animal. 


Decision Tree Algorithms


The method employed by these types of algorithms can be easily visualized with pen and paper, or in this case keyboard and word processor. The below example will illustrate how R2 the automated pizza deliverer will make a decision if it sees a dog running towards it. 


Sees Dog?


  Yes          No

|   |

Pedestrian/Object on Left?   Keep Driving


   Yes     No

        |         |

    Pedestrian/Object on Right?   Swerve Left


  Yes   No

        |                 |

              Stop    Swerve Right


Decision tree algorithms offer ML agents multiple branching structures that outline the consequences and reactions to their actions. Sometimes this involves the impact the agent will have on the environment, and sometimes it’s vice versa. The decision tree above outlines the decision-making process for how the agent reacts to an event, but it can also outline what initiatives the agent ought to take in order to change things in the environment.


You’ll notice that the decision tree we constructed has the option “Stop” as a worst-case scenario option. This may seem odd at first glance, as the dog is unlikely to severely damage or knock over R2, which makes stopping seem a viable and sensible option. However, prioritizing the “Swerve Left/Right” decisions speaks to a fundamental idea in machine learning, which is that the agent should always seek to maximize utility. 


In this case, maximizing utility in the face of a dog running wild down the sidewalk involves finding the decision that allows R2 to stay on track to delivering the pizza(s) as quickly as possible. Though stopping may not make the delivery lasting more than 30 minutes, R2 will still prefer the option that allows it to (safely) navigate the streets in the quickest way possible. 




There are different algorithms for different purposes. Bayesian algorithms help an agent make predictions, clustering algorithms allow an agent to make sense out of unknown percepts (i.e., what it sees/hears/encounters), and decision tree algorithms break down the decision-making process for an agent, replete with an ordering of preference.