This is Part 3 of our Foundations series. In Part 1, we covered data. In Part 2, models. Now we’re looking at algorithms: the methods that find patterns in data and produce models.
What Is an Algorithm?
An algorithm is a set of steps for solving a problem. A recipe is an algorithm. Driving directions are an algorithm. The process you use to sort your email is an algorithm.
In machine learning, an algorithm takes in data, looks for patterns, and produces a model. The model is the output. The algorithm is the process that creates it.
How Data, Models, and Algorithms Connect
Data shapes what algorithms can find. Bad data leads to bad models regardless of how sophisticated your algorithm is. Inconsistent formatting, missing values, mixed units. The algorithm can’t find real patterns if the data is internally contradictory.
Algorithms shape what kind of model you get. Different algorithms applied to the same data will produce different models. A simple algorithm might group customers by spending level. A more complex one might capture how spending changes over time, what products are bought together, and how customers respond to marketing.
Models reveal what data you actually need. I saw this on a factory project where our initial model showed we needed more detailed vibration data to predict equipment failures accurately. The model itself told us where our data was lacking.
These three feed into each other in a continuous loop. Better data enables better algorithms. Better algorithms produce better models. Better models tell you what data to collect next.
A Real Example
I worked on a project to predict equipment failures in a manufacturing plant. Thousands of sensor readings, maintenance records, and performance logs.
At first, the algorithm found noise. It predicted higher failure rates on Wednesdays, which made no sense. We nearly scrapped the project.
But as we refined our approach and tested our assumptions, real patterns emerged. We discovered that when bearing vibrations increased by 20% and ambient temperature rose more than 5 degrees, equipment failure followed within 72 to 96 hours. That finding let the plant schedule maintenance before breakdowns happened, saving significant downtime and cost.
The path from misleading correlations to meaningful patterns took patience, skepticism, and careful observation.
Types of Algorithms
Supervised learning algorithms learn from labeled examples. You show the algorithm thousands of X-rays labeled “pneumonia” or “healthy,” and it learns which visual patterns distinguish the two. The “supervised” part means you provide the correct answers during training.
Unsupervised learning algorithms find patterns without labels. You give the algorithm customer purchase data without telling it what to look for, and it might discover natural groupings: late-night shoppers, weekend-only buyers, frequent small-purchase customers. It finds this structure on its own.
Deep learning algorithms build understanding in layers. The first layer finds simple patterns like edges and colors. The next layer combines those into shapes. The next layer assembles shapes into features like ears or wheels. The final layer identifies the whole object. This layered approach is why they’re called “deep,” and it’s what makes them effective at complex tasks like speech recognition and image classification. The large language models behind ChatGPT and Claude are deep learning models with billions of parameters, trained on massive amounts of text. The underlying principle is the same: layers building on layers.
These three categories cover most of what you’ll encounter. There are more specialized types, but understanding these gives you a solid foundation.
From Learning to Predicting
Once an algorithm has found patterns and produced a model, that model can make predictions on new data. This is called inference (or scoring, depending on who you’re talking to). We cover the distinction between prediction and inference in depth in our Mental Models series.
Using the factory example: after the algorithm learned which sensor patterns preceded failures, the model could evaluate new sensor readings and flag machines that were likely to fail soon. We didn’t need to rerun the full learning process. The model applied what it already knew.
A medical model reads new X-rays in seconds. A retail model predicts inventory needs based on weather forecasts. A language model generates responses to questions it hasn’t seen before.
When Predictions Fail
Predictions go wrong when new data looks significantly different from training data, when the underlying patterns have changed since the model was trained, or when input data is incomplete or incorrect.
The best systems monitor prediction accuracy over time and retrain periodically with updated data. Models aren’t permanent. They need maintenance, just like the equipment they might be monitoring.
Correlation Is Not Causation
One more thing worth mentioning. On another project, an algorithm found a strong correlation between the number of fire stations in a city and the crime rate. More fire stations, more crime. Obviously, fire stations don’t cause crime. Both are symptoms of urban density and complexity. Larger, denser cities have more of both.
Algorithms find statistical patterns. They have no concept of cause and effect. Interpreting what patterns actually mean requires a person who understands the domain.
Looking Ahead
Algorithms take raw data and turn it into something useful. But they’re only as good as the data they receive and the humans who interpret their output.
In Part 4, we’ll look at the hardware that makes all of this run at the speed and scale required.