AI foundations

Machine learning: how systems learn patterns from data

A retail fraud team applied the same rule set for six years. They turned down orders over £500 that were sent to freight forwarders, flagged accounts that were used within an hour of being created, and blocked cards that were used in three different countries in a single day. Those rules worked until one quarter when they could not stop a new form of fraud. The new pattern consisted of small orders from established accounts within one country, spread over several months. The team had not added a rule for this behaviour because they had not encountered it before. Rules are limited because you can only document and search for patterns you already recognise.

Machine learning happens when a system discovers patterns from examples instead of following pre-written rules created by an engineer. You give the system labelled data, for example past transactions marked as fraudulent or legitimate. The system finds the combination of signals that separates these categories and then applies that insight to new cases.

Machine learning happens when you stop writing explicit rules and instead tell a system to find patterns by examining many examples. An engineer no longer types "if amount over £500 and destination is a freight forwarder, decline". Instead, you supply the system with years of transaction data that have already been labelled as fraud or not fraud. The system then discovers the mix of signals, which may include hundreds of variables, that separates the categories. No one needs to define the rule in advance. The system derives the rule from the existing data and uses those findings on new transactions.

At Shipshape Data, we construct data and AI systems for our clients. The most frequent mistake we see is not a technical flaw in an algorithm. Rather, organisations often apply machine learning to problems that could be handled with a simple spreadsheet formula. Conversely, some organisations keep using rules engines long after the underlying data patterns have become too complex for that method. Both mistakes happen because people do not clearly grasp the functional differences between machine learning and the manual rules it is meant to replace.

This guide outlines the three main types of machine learning: supervised, unsupervised, and reinforcement learning. It explains the training process that converts raw data into a reliable model and lists the most common algorithm families. It also gives criteria to decide whether a particular problem is suitable for machine learning or whether using these methods would be counterproductive.

Reasons that rules lose their effectiveness

A rules engine is a list of conditions that a person wrote based on patterns they had previously observed.

This approach works correctly as long as the data matches your expectations. It breaks when conditions change, because a rule only fires on the exact pattern it was designed to detect. Fraud, customer behaviour, and equipment wear change continuously.

Rules are explicit, learning is inferred

The accurate way to describe the difference is that a rules engine reflects a person's understanding of a pattern. A trained model reflects a pattern that a person did not need to understand. You give the model examples, and it adjusts its internal parameters until its predictions match the labelled outcomes. The end result is a set of weightings for many variables that no one analysed or designed manually.

This is the complete method, and it is also the total cost.

A rules engine provides the specific reason for declining an order. A trained model indicates that it declined the order, but the reasoning is spread across hundreds of weighted signals that were not manually recorded and cannot be fully interpreted.

The trade nobody mentions upfront

Sales conversations often leave out this information. Moving from rules to machine learning enables the discovery of patterns that cannot be defined manually. However, this shift means you can no longer point to a single line of code to explain a result. Some industries accept this trade-off. Other sectors, such as credit lending and regulated financial advice, cannot ignore the issue. In those cases, a simpler model that offers clear explanations is often more valuable than a slightly more accurate model that no one can account for.

Three methods for system learning

Machine learning consists of several distinct techniques rather than a single method applied in different ways.

You can frame the learning problem in three distinct ways. If you pick the wrong method, you may spend months developing before discovering that the model cannot work as intended.

Supervised learning: learning from labelled data

Supervised learning is the most common approach and is likely what most people associate with the field. You give the system input data and the correct answer for each example. For example, you might use thousands of past loan applications marked as approved or defaulted, or thousands of emails marked as spam or not. The system learns the relationship between these inputs and their labels. After training, it uses that relationship to predict answers for new cases. This method needs labelled data, which is expensive to produce. However, it is the most reliable and well-understood approach available. Our guide on supervised learning explains the primary algorithms and their specific uses.

Unsupervised learning: finding structure nobody labelled

Unsupervised learning does not use labelled data. You give the model data that has no pre-defined categories and let it discover internal structures. This process shows which customers share similar behaviours, which transactions are outliers, and which variables are redundant or move together. The model does not receive instructions on what a specific segment should look like. Instead, it finds patterns based on the data's own distribution. This approach is a common first step when you suspect a dataset contains a structure you have not yet identified. The unsupervised learning guide covers the main techniques for this work, including clustering and dimensionality reduction.

Reinforcement learning: learning from consequences

Reinforcement learning is different from the other methods and receives more attention than its business utility justifies. This approach does not use a set of correct answers. An agent takes actions in an environment, receives rewards or penalties based on the outcomes, and adjusts its behaviour to increase its total reward. This method lets systems outperform humans at games. It is also used in robotics, logistics routing, and certain pricing tasks. However, it is not suitable for most corporate data problems. It requires a simulation environment that is cheap to run many times, which most companies do not have. While it works well for a small number of specific tasks, it is often suggested for situations where it does not apply.

What training actually looks like, step by step

Training a model follows a straightforward sequence of steps that vary slightly depending on the specific problem. Most of the work occurs earlier in the process than people usually anticipate. None of these initial stages are typically shown during demonstrations.

Preparing the data

Most of the work consists of these routine tasks, which is where many projects stop progressing. Raw data often contains duplicates, incorrect labels, and missing fields. Different systems may also define customers in conflicting ways. A more advanced algorithm cannot resolve these issues. They are resolved by manually reviewing the data, deciding how to handle missing information, and applying those decisions consistently. Poor data quality often appears to be a modelling problem later in the process, even though the issue originated with the data itself. Once the data is clean, features are engineered to turn raw fields into signals for the model. Examples include calculating an age from a date of birth, a rolling average from transaction records, or a distance between two postal codes.

Splitting, fitting, and testing honestly

Data is divided into three parts. The model learns from the training set, while the validation set is used to adjust settings during the process. The test set is used only once at the end to provide an accurate assessment of performance. The model fits itself to the training data by changing its internal parameters to minimise the difference between its predictions and the actual answers. This stage requires careful management. A model that works well on training data but fails on new data has not learned the underlying pattern. Instead, it has memorised the specific examples. We have provided detailed information on this failure in our guide to overfitting. This issue is the most frequent reason that models fail when they are applied to real-world data.

Deployment is not the finish line

A model that performs well in testing must still function correctly with production data. This data changes when real users, seasonal trends, and edge cases affect the system. Monitoring should be integrated into the deployment process from the beginning rather than added after a failure occurs. The conditions present during training do not stay the same. Customer behaviour, prices, and fraud patterns evolve, often because the model itself has forced those patterns to adapt. If a model is not updated, its accuracy will decrease as it loses alignment with current data. Retraining the model on a set schedule or when accuracy drops is a necessary part of operations rather than an optional task.

The algorithm families you will encounter

The three learning styles are based on a small group of algorithm families. These families appear in various combinations across most practical projects. Understanding how each family works helps you avoid misjudging the complexity of a problem or building a system that is more complicated than necessary.

Linear models and decision trees

Linear and logistic regression are basic tools that fit a straight line or a probability curve through data. These methods are effective for problems where relationships are approximately linear. They are fast, easy to explain, and are often the appropriate starting point for analysis. Decision trees divide data based on specific questions, such as whether an order value exceeds £500 or if a customer is new. This process creates a flowchart that is easy for a person to read. Both methods are useful. A linear model that a compliance team can understand is sometimes better than a slightly more accurate model that no one can explain.

Ensembles: many weak models outvoting one model

A single decision tree often overfits because it captures noise until every training example is placed in its own small branch. Ensembles resolve this issue by combining multiple trees instead of relying on one. Random forests train many trees on different subsets of the data and average their results. Gradient boosting trains trees sequentially, so each new tree corrects the errors made by the previous ones. Both methods usually perform better than a single tree on complex tabular data. They are the standard choice for many structured business problems, such as predicting churn, setting prices, and assessing credit risk, that are solved with machine learning.

Neural networks

Neural networks consist of stacked layers of mathematical units. Each unit combines and adjusts the weight of signals from the previous layer. With sufficient layers, data, and computing power, these networks can approximate nearly any pattern. This capability makes them effective for processing images, audio, and language. These tasks involve unstructured input that cannot be captured by manual feature engineering. However, neural networks are often an inappropriate choice for standard spreadsheets of customer records. In those cases, simpler models achieve similar performance while requiring significantly less data and computing power. These simpler models are also easier to explain.

Best for unstructured inputs, images, audio, free text, where the signal genuinely can't be hand-engineered into a simpler model. Watch for: reaching for a neural network on tidy, structured business data out of habit. A gradient-boosted ensemble will usually match it on accuracy, train in a fraction of the time, and let you explain a prediction when someone eventually asks.

Spotting a problem machine learning actually suits

You do not need a model for every prediction problem. Treating every question as a machine learning task is an expensive habit for data teams. You can identify genuine candidates and avoid wasting time by performing a few basic checks.

Questions to ask before you begin

You must determine if there is a consistent pattern that appears frequently enough in your data for a model to learn. A single event does not provide enough information for a model to generalise. You need a sufficient amount of historical data that has been labelled accurately, rather than using a proxy that was simply easy to record. Consider whether a human expert would find it difficult to write down the rules using the same inputs. If a colleague can explain the logic on a whiteboard in ten minutes, you should use that logic instead of a model. You must also be able to accept occasional errors. Every model will be wrong some of the time. If a project requires zero errors, it is not currently suitable for machine learning, regardless of what the roadmap indicates.

Fraud, churn, demand forecasting, predictive maintenance, and image and text classification: these keep showing up as good fits because they share the same shape. A real pattern, enough history, a rule too complex for a person to hand-write, and a business that can absorb the model being wrong on the cases at the margin.

Best for problems with a genuine, recurring pattern and a large enough labelled history to learn it from, where a person would struggle to write the rule down by hand. Watch for: a business asking for a model when what it wants is a report. If nobody can say what decision the prediction changes, building the model first is building the wrong thing first.

When machine learning is the wrong solution

Identifying a poor fit is as necessary as recognising a good one. Most vendors do not include this information.

There are times when the most accurate response is that this is not necessary for you.

If the logic consists of a few conditions that rarely change, a rules engine is more cost-effective, transparent, and easier to maintain. If your data is insufficient, too recent, or inconsistently labelled, a model will learn noise instead of useful patterns. This is worse than having no model because it provides an incorrect answer that appears valid. If the underlying pattern changes faster than you can retrain, such as a demand spike caused by weather that was not recorded last year, a model built on historical data will continue to predict past trends. It will remain confident in these predictions until they are proven wrong.

We have taken part in numerous scoping meetings where projects employ machine learning just to seem more sophisticated. Sometimes, a dashboard together with a documented rule is the appropriate solution. Giving this honest advice is more valuable to the client than pretending another approach is required.

Where to start

First, identify the problem before choosing a technique. Specify the exact decision the model is meant to influence and verify that you possess existing data for training. Check whether a person can describe the underlying pattern in one sentence. If someone can explain the pattern easily, a model is probably unnecessary. If the pattern is too complex to describe and you have enough historical data, the project is a good candidate for machine learning.

First, build a solid foundation: clean, consistently labelled data, a proper split of data for training and testing, and early monitoring when issues arise. These tasks may not be exciting, yet they decide if the resulting model will be reliable for business use.

If you are trying to determine whether a problem you are examining truly fits machine learning, or you already have a model built and are unsure if it was ever the right tool, talk to us.

Many AI projects fail because teams are unable to apply these concepts effectively. Our AI consultancy assists organisations in overcoming this particular challenge.

If you want outside help to take a model from business question to production, our guide to what a machine learning consulting engagement covers outlines the stages and shows where the effort goes.

Frequently asked questions

What is machine learning?

Machine learning happens when a system discovers patterns from labelled examples rather than following rules written by an engineer. You give the system thousands of past cases, for example transactions already marked as fraud or not fraud. The system discovers the specific signals that separate these categories and applies those findings to new cases. This approach works well for problems that involve recurring patterns that are hard for a person to define as a formal rule.

What is the difference between machine learning and AI?

Artificial intelligence is the broad field of building systems that perform tasks requiring intelligence. Machine learning is a particular method within this field that finds patterns in data rather than following manual rules. A rules engine is another form of artificial intelligence that does not involve learning. Machine learning is useful when patterns are too complex or change too often for a person to define them manually.

What is deep learning?

Deep learning is a kind of machine learning that uses layers of mathematical units. Each layer processes and weights signals coming from the previous layer. When these models have sufficient layers, data, and computing power, they can identify nearly any pattern. This makes deep learning effective for processing images, audio, and language. These tasks involve unstructured data that cannot be captured by manual programming. However, deep learning is generally not the best choice for standard spreadsheets of customer records. In such cases, simpler models achieve similar results at a much lower cost.

What is the difference between supervised and unsupervised learning?

Supervised learning uses input data paired with the correct answer for each example. For example, a model might process thousands of past loan applications that are already marked as approved or defaulted. The system learns the relationship between the inputs and these results so it can predict outcomes for new cases. Unsupervised learning does not use an answer key. It processes unlabeled data to identify internal structures, such as grouping customers based on similar behaviours. Supervised learning requires labelled data, which is costly to produce. Unsupervised learning is often the first step when you believe data contains patterns but have not yet identified them.

What is the difference between machine learning and deep learning?

Deep learning is a category of machine learning that uses layers of neural networks. Machine learning also includes other methods such as linear models, decision trees, and ensembles like random forests or gradient boosting. Deep learning is usually more effective for unstructured data, including images, audio, and text, because these formats make it hard to manually design features for simpler models. For structured business data, gradient-boosted ensembles often deliver the same accuracy as deep learning. These ensembles also train faster and are easier to interpret when explaining how the model arrived at a specific prediction.

Start at your core.

Tell us where your data is today and what you want AI to do. We'll come back with a straight answer on what your foundation needs and where the quickest real win is.

Talk to us