Unsupervised Learning: How It Finds Patterns in Business Data
Short answer Unsupervised learning is machine learning that gets no right answers to learn from. It looks at your raw records and finds structure on its own. The two jobs a business uses most: clustering, which sorts customers into groups that behave alike, and association, which finds what people buy together. You still choose the inputs and name the groups.
Want help applying this to your business? Talk it through on a free 30-minute call.
Book a callWhat is unsupervised learning?
It is machine learning without an answer key. You hand the software a table, say one row per customer, and it reports which rows resemble each other or which items keep showing up together. Nobody told it what to look for. Google's glossary defines it this way:
"Training a model to find patterns in a dataset, typically an unlabeled dataset." (Google Machine Learning Glossary)
"Unlabeled" means no column says what the right answer is. A customer list with visits, spend and services has no label. Add a column "cancelled: yes or no" and you have a label.
| Supervised learning | Unsupervised learning | |
|---|---|---|
| What it gets | Past examples with the answer filled in | Raw records, no answer column |
| What it does | Predicts the answer for new cases | Finds groups, links and odd cases |
| Business question | "Which of these leads will book?" | "What kinds of customers do I have?" |
| You need | Enough past outcomes to learn from | Clean records with useful columns |
Google's course puts the core of it in one line: supervised models learn "after seeing lots of data with the correct answers" (Google for Developers). Unsupervised models never see correct answers.
Clustering: how it sorts customers into groups
Clustering is the main use. Google's glossary says "the most common use of unsupervised machine learning is to cluster data into groups of similar examples" (Google Machine Learning Glossary). For a business, the examples are customers and the groups are segments.
The most used method is k-means (Google for Developers: Clustering algorithms). Here is what it does with a customer list:
- You pick the number of groups, called k. Say 4. The method can't choose it for you: "This algorithm requires the number of clusters to be specified" (scikit-learn).
- It drops 4 starting points into the data, one per group.
- Each customer joins the nearest point, measured on the columns you gave it: visits a year, average ticket, months since last job.
- Each point moves to the middle of its customers.
- Steps 3 and 4 repeat until nobody switches groups.
What you get back is a group number on each customer. Not a name, not a meaning. Google is blunt about this:
"An unsupervised approach doesn't know what the clusters of data mean. Based on your understanding of the data, it's up to you to define them." (Google for Developers: What is machine learning?)
So you read each group's averages and name it yourself: "big yearly spenders", "one-time emergency calls", "regulars who went quiet". That naming step is where the business value comes from, and it is yours.
Which clustering method fits?
| Method | How it groups | Watch out for |
|---|---|---|
| K-means | Around a center point for each group | You set the group count; outliers pull the centers (Google) |
| DBSCAN (density-based) | Where customers sit close together | Lone records are flagged as outliers, not grouped (scikit-learn) |
| Hierarchical | Builds a tree of groups inside groups | Most methods slow down on big lists; k-means scales well (Google) |
| Gaussian mixture | Gives each customer a chance of belonging to each group (Google) | Harder to explain to a team |
For a customer list of a few hundred to a few thousand rows, k-means is the usual start. Try 3, 4 and 5 groups and keep the version whose groups you can act on.
Association: what gets bought together
Association finds rules like "people who buy X often buy Y". It works on orders, not customers: each row is one order and the items in it. Retailers call this market basket analysis.
Three numbers decide whether a rule is worth using. Apache Spark's documentation defines them:
- Support: how often the items appear at all. "If an item appears 3 out of 5 transactions, it has a support of 3/5=0.6."
- Confidence: of the orders with X, how many also had Y. It is "an indication of how often an association rule has been found to be true."
- Lift: whether X really raises the odds of Y, or Y is just popular. Above 1 means they go together more often than chance.
(Apache Spark 4.3.0: Frequent Pattern Mining). Spark finds these rules with a method called FP-growth; you don't need to know how it works to read the output.
A worked case. A home services company has 1,000 jobs. Gutter cleaning is in 200, window washing in 250, both in 100.
| Measure | Math | Result |
|---|---|---|
| Support (both) | 100 ÷ 1,000 | 0.10 |
| Confidence (gutters → windows) | 100 ÷ 200 | 0.50 |
| Lift | 0.10 ÷ (0.20 × 0.25) | 2.0 |
Half of gutter customers also book windows, twice the rate you'd expect by chance. That is a bundle worth offering on the gutter booking page.
Online stores may already run a version of this. Shopify says its automatic related products can weigh "products that have historically been purchased together" (Shopify Dev). Its add-on ("complementary") suggestions are not automatic: "Complementary recommendations need to be manually set up" (Shopify Dev). An association analysis tells you which ones to set.
What else does it do?
Two more jobs, less common for a small business:
- Anomaly detection: flags records that fit no pattern, such as a refund spike or a fake lead flood. Google's glossary calls it "the process of identifying outliers" (Google Machine Learning Glossary).
- Dimension reduction: squeezes many columns into a few, so 40 survey answers become 3 scores you can chart. It often runs before clustering (Google for Developers).
What data do you need?
A table with one row per customer (or per order) and a handful of numeric columns that describe behavior. For customers, the usual ones are how recently they bought, how often, and how much. For orders, the items in each.
Two preparation rules matter:
- Put columns on the same scale. Google's clustering course says comparing customers "requires the features to have the same scale" (Google for Developers: Prepare data). Otherwise a $5,000 spend column swamps a 3-visit column and the groups just sort by spend.
- Handle the outliers. One $80,000 commercial job can drag a k-means group center on its own. Google suggests removing or clipping outliers first (Google for Developers).
Strip names, emails and phone numbers before you upload records to any AI tool. The privacy rules for that, in the US and Canada, are in AI customer segmentation and personalization.
How do you know the groups are real?
You test them. There is no answer key to grade against:
"Because clustering doesn't produce or include a ground "truth" against which you can verify the output, it's important to check the result against your expectations at both the cluster level and the example level." (Google for Developers: Clustering workflow)
In practice:
- Look at 10 customers in each group. If you can't say why they belong together, change the columns or the group count.
- Check the groups are big enough to act on. A group of 12 is a list, not a segment.
- Send each group a different offer and compare replies or bookings. A segment that responds the same as everyone else isn't worth keeping.
Can a small business use it without a data scientist?
Yes, for the two jobs above. The tools changed: you can describe the task in plain words and let an AI tool write and run the code.
| Way | What it does | Good for |
|---|---|---|
| A chatbot with file upload | Runs k-means or basket analysis on a spreadsheet you upload | A one-time look at a few thousand rows; steps in AI customer segmentation |
| Your store or email platform | Built-in related products or segments | Ongoing use without exports |
| Rules you write yourself | "Spent over $1,000, no job in 12 months" | Fewer than a few hundred customers; see market segmentation |
With a small list, simple rules often beat clustering. Clustering earns its keep when you have many columns and can't eyeball the groups.
Example
A cleaning company with 1,500 customers (USD)
The owner exports one row per customer: jobs in the past year, average job price, months since last job. A chatbot runs k-means for 4 groups. She reads the averages and names them: weekly regulars (300), move-out one-timers (600), seasonal deep cleans (400) and lapsed regulars (200). The lapsed group, averaging $1,800 a year before going quiet, gets a win-back email first.
A bike shop with 8,000 online orders (CAD)
An association run on the orders finds helmets in 900 orders, lights in 600, and both in 360. Confidence from helmets to lights is 40%, and lift is 5.3. The shop sets lights as the add-on on every helmet page.
FAQ
Is unsupervised learning the same as AI?
It is one kind of machine learning, which is one part of AI. A chatbot with file upload can run clustering for you, but the chatbot itself is a different kind of AI.
How many customers do I need for clustering?
There is no fixed minimum. With fewer than a few hundred customers, you can usually see the groups yourself with simple filters, so clustering adds little.
What's the difference between clustering and segmentation?
Segmentation is the marketing goal: groups you treat differently. Clustering is one way to find those groups from data instead of choosing them by hand.
Can unsupervised learning predict who will buy?
No. Predicting an outcome needs past examples of that outcome, which is supervised learning. Clustering can feed a prediction, though, by adding the group number as one more column.
Different for you?
- You want to act on the groups in email and texts: Behavioral email segmentation.
- Your customer records are thin or scattered: First-party data in AI marketing.
- You'd rather pick segments by hand: Market segmentation.
- You want the groups turned into pages and offers that convert: Conversion.