Skip to content
15% Off Your Second Order · Minimum Order £50 15% Off Second Order · Minimum £50

Data Mining for E-Commerce Personalization: A Computer Science Dissertation Sample

A masters computer science dissertation sample on data mining for e-commerce personalization. It cleans the UCI Online Retail dataset, scores 4,338 customers on how recently, how often and how much they bought (RFM), groups them with k-means, finds products bought together, and tests three recommenders offline. Every figure comes from a script you can rerun, and the limits are stated.

This is a masters computer science dissertation sample on the use of data mining to improve e-commerce personalization. It runs the complete five-chapter structure: introduction and research questions, literature review, methodology, findings, and discussion and conclusion. The empirical chapter is a real run on the Online Retail transaction dataset (December 2010 to December 2011): RFM features, k-means segmentation, co-purchase mining and an offline test of three recommenders. Every number in Chapter 4 comes from one Python script, described in Chapter 3, that you can rerun on the public file.

How Does Data Mining Improve E-Commerce Personalization?

By turning transaction history into groups and predictions. Clustering separates customers who behave differently, association rules find products that sell together, and filtering methods predict what an individual is likely to want next. The store then changes what it shows to each visitor, instead of showing everyone the same page.

The commercial argument is that a relevant recommendation converts better than a generic one. Amazon's engineers reported that the click-through and conversion rates of their item-to-item recommendations "vastly exceed" those of untargeted content such as banners and top-seller lists (Linden, Smith and York, 2003). A dissertation cannot usually measure clicks, so the question it can answer is narrower and more useful: on a transaction file alone, does a personalized recommender predict what customers go on to buy better than a list of bestsellers does? That is what Chapter 4 tests.

Which Data Mining Techniques Are Used for Personalization?

Four recur across the literature. Clustering, usually k-means over recency, frequency and monetary features, for customer segmentation. Association rule mining for basket analysis (Agrawal, Imieliński and Swami, 1993). Collaborative filtering, which recommends from the behavior of similar users or similar items (Linden, Smith and York, 2003). Content-based filtering, which recommends from item attributes. Adomavicius and Tuzhilin (2005) classify recommenders into content-based, collaborative and hybrid, and deep learning methods extend the collaborative family rather than replacing it (He et al., 2017).

RFM analysis is worth naming separately because it is the input to most of the above. It scores each customer on how recently they bought, how often, and how much they spent, all three computable directly from a transaction table. Chen, Sain and Guo (2012) used exactly this pipeline, RFM then k-means, on the dataset below.

Which Dataset Does This Dissertation Use?

The Online Retail dataset: 541,909 transaction rows from a UK-based, non-store online gift retailer between 1 December 2010 and 9 December 2011, with invoice number, stock code, description, quantity, invoice date, unit price, customer ID and country. It was donated to the UCI Machine Learning Repository by Daqing Chen of London South Bank University on 5 November 2015 and is published under a Creative Commons Attribution 4.0 license (Chen, 2015).

The Online Retail dataset before cleaning

Transaction rows
541,909
Distinct invoices
25,900
Customers with an ID
4,372
Countries
38
Rows without a customer ID
24.9%
Counts from the repository file as downloaded on 24 September 2026. A quarter of the rows have no customer ID and cannot be used for segmentation. Source: Chen (2015), UCI Machine Learning Repository

It is a good teaching dataset because it is small enough to run on a laptop, dirty enough to need real cleaning, and it carries a customer ID, which is what makes segmentation possible. A quarter of the rows have no ID, 9,288 rows are cancellations, and the quantity column runs from minus 80,995 to plus 80,995, so the cleaning decisions are part of the method rather than a preliminary. It is also old: any conclusion about current shopping behavior has to be stated as a limitation rather than a finding.

More computer science work is in our computer science assignment samples, and our computer science assignment help page explains how we take a brief. The shorter computer science dissertation sample shows the same structure at proposal length.

Chapter 1: What Problem Does This Dissertation Address?

That online retailers hold a full record of what every customer bought and use very little of it. The study asks how far three standard data mining techniques, RFM segmentation with k-means, co-purchase mining and a segment- or basket-based recommender, can turn one retailer's transaction file into a personalization strategy, and how the result should be measured when no click data exists.

Background and Rationale

Data mining is one step in the wider process of knowledge discovery in databases: the application of algorithms to extract patterns from data, preceded by selection and preparation and followed by interpretation (Fayyad, Piatetsky-Shapiro and Smyth, 1996). In retail the patterns of interest are groups of customers who behave alike, products that sell together, and predictions of what a given customer will want next. Each supports a different personalization decision: whom to contact, what to bundle, and what to show.

The techniques are mature. Item-to-item collaborative filtering has run at Amazon since the early 2000s, chosen because its online computation scales independently of the number of customers and products (Linden, Smith and York, 2003). Matrix factorization outperformed nearest-neighbor methods in the Netflix Prize (Koren, Bell and Volinsky, 2009), and neural collaborative filtering has since replaced the inner product of factorization models with a learned function (He et al., 2017). What is less mature is the practice in small firms. Chen, Sain and Guo (2012) opened their study of this same dataset by observing that many small online retailers want to practice data mining and lack the expertise to do so.

The rationale for the study is therefore practical. A method that runs on a laptop, on the transaction table every retailer already has, and that can be evaluated without a live experiment, is the method a small retailer could adopt. The dissertation builds and tests one.

Aim, Objectives and Research Questions

The aim is to determine how data mining on transaction data alone can support personalization in e-commerce. Three objectives follow from it.

  • To segment the retailer's customers by recency, frequency and monetary value using k-means, and to describe each segment in terms a marketing team can act on.
  • To identify the product pairs most often bought together and quantify the strength of each association.
  • To build recommenders from the segments and from the co-purchase pairs, and to test them offline against a most-popular baseline.

Four research questions give those objectives testable form.

  1. How many customer segments does the RFM data support, and how well separated are they?
  2. Which products are bought together, and how strong are the associations?
  3. Does a recommender that uses the segment, or the customer's own basket, predict later purchases better than recommending the most popular products?
  4. What do the results allow the retailer to do differently, and what are the legal and ethical limits on doing it?

Significance and Scope

The contribution is a reproducible, end-to-end personalization pipeline on public data with an honest evaluation. The scope is deliberately narrow: one dataset, one year, RFM features only, k-means only, and offline evaluation only. Deep learning and reinforcement learning methods are discussed in Chapter 2 and not implemented, which is restated as a limitation in Chapter 5.

Chapter 2: What Does the Literature Already Establish?

That collaborative filtering works and scales, that factorization and neural models beat neighborhood methods on accuracy at a higher engineering cost, that RFM with k-means is the standard segmentation on transaction data and has already been applied to this dataset, and that offline evaluation of a recommender is well defined but measures prediction, not sales.

Which Recommendation Methods Does the Literature Compare?

Adomavicius and Tuzhilin (2005) survey the field and classify recommendation methods into three categories: content-based, which recommend items similar to those the user liked before; collaborative, which recommend what similar users liked; and hybrid, which combine the two. They list the limitations of each, and the one that matters most for a transaction dataset is sparsity: the number of observed interactions is very small compared with the number that must be predicted, so any method has to make a great deal from little.

Linden, Smith and York (2003) describe the practical answer Amazon adopted. Traditional collaborative filtering searches for customers whose purchases overlap the target customer's, which becomes slow with tens of millions of customers and millions of items. Item-to-item collaborative filtering instead precomputes, for each product, the products most often bought alongside it, so the online step is a lookup whose cost does not grow with the customer base. The same paper notes that new customers have extremely limited information and that customer data is volatile, which is why the similarity table has to be rebuilt as transactions arrive.

Koren, Bell and Volinsky (2009) set out the two broad strategies, content filtering from profiles and collaborative filtering from past behavior, and report that matrix factorization models proved superior to classic nearest-neighbor techniques in the Netflix Prize, with the additional ability to absorb implicit feedback, temporal effects and confidence levels. He et al. (2017) take the next step and replace the inner product at the heart of matrix factorization with a multilayer neural network that learns an arbitrary interaction function, reporting better results than existing methods on two real-world datasets. Both papers work on ratings or implicit-feedback matrices; neither requires anything a transaction file lacks, but both require more tuning than a small retailer would want to maintain.

What Is Known About RFM Segmentation in Online Retail?

RFM segmentation is the established method for grouping customers from transaction data, and it has already been applied to the dataset used here. Chen, Sain and Guo (2012) computed recency, frequency and monetary value for each customer of the same UK gift retailer, clustered them with k-means, and used decision tree induction to describe the resulting segments, ending with a set of consumer-centric marketing recommendations for the business. Their study was written explicitly for small online retailers and new entrants who lack data mining expertise, and it was carried out in SAS Enterprise Guide and Enterprise Miner.

That paper fixes the starting point for this dissertation. It establishes that the dataset supports meaningful RFM segments and that k-means is an acceptable method; it does not build a recommender, mine product associations or evaluate anything against a baseline. Those are the steps added here, in open-source tools rather than SAS.

How Are Recommenders Evaluated?

Herlocker et al. (2004) review the decisions involved in evaluating collaborative filtering recommenders: which user task is being evaluated, what dataset and analysis are used, how prediction quality is measured, and how attributes other than quality are assessed. For a top-N task the natural measures are precision and recall, which require separating the items into the set that was recommended and the set that was not, and then counting how many recommended items the user in fact wanted. Their empirical finding is sobering: on one domain the accuracy metrics they tested collapsed into three groups, strongly correlated within a group and uncorrelated between groups, so the choice of metric can change which algorithm wins.

Two consequences follow for a dissertation on transaction data. First, an offline test on held-out purchases measures how well a recommender predicts what customers bought anyway; it does not measure whether showing the recommendation caused a sale. Click-through and conversion need a live system with impressions logged, which a public transaction file does not contain. Second, any offline result is only meaningful against a baseline, and the honest baseline is to recommend the most popular products to everyone.

What Are the Legal and Ethical Constraints?

Personalization runs on personal data, and in the UK and the EU the processing is governed by Regulation (EU) 2016/679, the General Data Protection Regulation. Article 22 gives the data subject the right not to be subject to a decision based solely on automated processing, including profiling, which produces legal effects concerning them or similarly significantly affects them (European Parliament and Council, 2016). Segmenting customers to choose which offer they see is profiling; whether a given use "similarly significantly affects" a customer is a judgement the retailer has to make and document before deploying, and it is the reason a deployment plan includes a lawful basis and a human review path, not only a model.

Beyond the legal floor, three risks recur in the recommender literature reviewed above and are noted here because they bear on the segments in Chapter 4. A model trained on historical purchases reproduces the pattern in those purchases, so a segment of low-spending customers will keep being shown low-priced products. Sparse data means new customers are recommended the same bestsellers as everyone else, which is the cold-start problem Linden, Smith and York (2003) describe. And a segment label is a description of past behavior, not a fact about the person; treating it as one, for example by withholding offers from "lapsed" customers, is the kind of decision Article 22 was written for.

What Gap Does This Dissertation Fill?

The literature treats customer segmentation and recommendation as two subjects. Chen, Sain and Guo (2012) segmented this dataset and stopped at marketing recommendations; the recommender literature evaluates algorithms on ratings datasets where the customer segment is not a variable. This dissertation joins the two on one transaction file: it builds RFM segments, mines co-purchase pairs, and then asks whether either improves a recommender's offline precision over a bestseller list, with the method exposed in enough detail to be rerun.

Chapter 3: How Was the Study Carried Out?

On one public transactional dataset, cleaned by explicit rules, reduced to three RFM features per customer, segmented with k-means for k = 2 to 8, mined for product pairs by support, confidence and lift, and used to test three recommenders on a time split. The process framework is CRISP-DM and the implementation is in Python with pandas, scikit-learn and SciPy.

The Dataset

The Online Retail dataset records all transactions of a UK-based and registered non-store online retailer between 1 December 2010 and 9 December 2011. The company mainly sells unique all-occasion gifts, and many of its customers are wholesalers (Chen, 2015). The file was downloaded from the UCI Machine Learning Repository on 24 September 2026 as a 23 MB Excel workbook; the repository lists 541,909 instances and six features, counting the invoice number and stock code as identifiers rather than features.

Attributes, Missing Data and Cleaning

Eight columns describe each row: InvoiceNo, StockCode, Description, Quantity, InvoiceDate, UnitPrice, CustomerID and Country. Quantity and UnitPrice are numeric; Country and Description are categorical; InvoiceDate carries the time of day. A row is one product line on one invoice, so an invoice with fifteen products occupies fifteen rows.

Four cleaning rules were applied in order, and the row counts after each are reported in Chapter 4. Rows without a CustomerID were dropped rather than imputed, because a segmentation needs a customer and inventing one would invent a segment. Cancellations, identified by an invoice number beginning with C, were dropped along with any row with a non-positive quantity or price, which removes returns, adjustments and manual postings. Exact duplicate rows were dropped last. Rows without a product description were retained where they carried a customer ID, since the stock code identifies the product.

CRISP-DM as the Process Framework

CRISP-DM, the Cross-Industry Standard Process for Data Mining, was published in 1999 to standardize data mining projects across industries and remains the most widely used process model for analytics work (Data Science Process Alliance, n.d.). Its six phases structure this study: business understanding fixed the objective; data understanding produced the descriptive statistics; data preparation applied the cleaning rules and built the RFM table; modeling ran k-means, the co-purchase count and the recommenders; evaluation applied silhouette, inertia and the offline metrics; and deployment is the marketing plan in Chapter 4 and the recommender a retailer could run.

The six CRISP-DM phases as applied in this study

  1. Business understanding Define the objective: segment the customer base and recommend products so that marketing contact is targeted rather than uniform.
  2. Data understanding Profile the raw file: 541,909 rows, 24.9 percent without a customer ID, 9,288 cancellation rows, 38 countries.
  3. Data preparation Drop rows without a customer ID, cancellations, non-positive quantities or prices and exact duplicates; compute recency, frequency and monetary value per customer.
  4. Modeling K-means on log-transformed, standardized RFM for k = 2 to 8; co-purchase pairs with support, confidence and lift; three recommenders.
  5. Evaluation Silhouette and inertia for the clustering; precision@10, recall@10, hit rate and coverage on a time-split test for the recommenders.
  6. Deployment A segment-by-segment marketing plan and a co-purchase recommender that a small retailer can run on a laptop.
The phases are not strictly sequential: the evaluation of the first k-means run sent the work back to data preparation to add a log transform.

Feature Engineering: RFM

For each customer, recency is the number of days between their last invoice and the day after the last invoice in the file, so the most recent buyer scores 1. Frequency is the number of distinct invoices. Monetary value is the sum of quantity multiplied by unit price across all of the customer's rows. All three are heavily right-skewed (a few wholesalers place hundreds of orders), so each was transformed with log(1 + x) and then standardized to zero mean and unit variance before clustering, which stops the monetary column from dominating the Euclidean distance.

Experimental Design

Clustering. K-means was run on the three standardized features for every k from 2 to 8, with k-means++ initialization, twenty random restarts and a fixed random seed of 42, keeping the run with the lowest inertia (scikit-learn developers, 2026a). Two measures were recorded for each k: inertia, the sum of squared distances from each customer to their cluster center, and the mean silhouette coefficient, which compares each customer's mean distance to their own cluster with their mean distance to the nearest other cluster and ranges from minus 1 to 1 (Rousseeuw, 1987; scikit-learn developers, 2026b). Values near 0 indicate overlapping clusters.

Co-purchase mining. For every pair of products, the number of invoices containing both was counted, and support, confidence and lift were computed in the sense of Agrawal, Imieliński and Swami (1993): support is the share of all invoices carrying the pair, confidence is the share of invoices carrying A that also carry B, and lift is that confidence divided by the base rate of B. Only pairs with support of at least 1 percent were reported.

Offline recommender test. The cleaned data was split by date: invoices before 1 September 2011 formed the training period and the remaining 100 days the test period. For every customer active in both periods, three recommenders each produced ten products the customer had not bought in training: (a) the ten products bought by the most customers overall, the baseline; (b) the ten bought by the most customers in the same RFM segment, with segments refit on training data only; and (c) the ten products most often co-purchased with the products in the customer's own training basket, which is item-to-item collaborative filtering in the sense of Linden, Smith and York (2003). Each list was scored against what the customer bought in the test period by precision@10 (hits out of ten), recall@10 (hits out of the customer's test purchases), the share of customers with at least one hit, and catalog coverage, the share of all training products that appeared in any recommendation.

Software. Python 3 with pandas for data handling, scikit-learn for clustering and the silhouette, SciPy sparse matrices for the product co-occurrence counts, and openpyxl to read the workbook. The whole run completes in a few minutes on a laptop.

Table 3.1: Research design summary
AspectDetails
DatasetOnline Retail, UCI Machine Learning Repository, 541,909 rows, 1 December 2010 to 9 December 2011, CC BY 4.0 (Chen, 2015).
CleaningDrop rows without a customer ID, cancellations, non-positive quantity or price, exact duplicates.
FeaturesRecency (days), frequency (distinct invoices), monetary value (GBP); log(1 + x) then standardized.
SegmentationK-means, k = 2 to 8, k-means++, 20 restarts, seed 42; chosen by silhouette and interpretability.
Association miningProduct pairs by invoice co-occurrence; support, confidence, lift; support of at least 1 percent.
Recommender testTime split at 1 September 2011; three recommenders; precision@10, recall@10, hit rate, coverage.
Process frameworkCRISP-DM: business understanding, data understanding, data preparation, modeling, evaluation, deployment.

Chapter 4: What Did the Segmentation and the Recommender Find?

Four customer segments rather than five, with a silhouette score of 0.34, so the clusters overlap. The 709 core repeat buyers are 16 percent of customers and produce 65 percent of revenue. The 1,617 lapsed one-time buyers are 37 percent of customers and produce 6 percent. A co-purchase recommender reached precision@10 of 7.2 percent against 4.7 percent for a bestseller list.

Descriptive Statistics

The raw file has 541,909 rows across 25,900 invoices, 4,070 stock codes, 4,372 identified customers and 38 countries. The United Kingdom accounts for 91.4 percent of rows, followed by Germany (9,495 rows), France (8,557) and Ireland (8,196). The two numeric columns show why cleaning matters: quantity has a mean of 9.55 and a median of 3, with a minimum of minus 80,995 and a maximum of 80,995, which is one bulk order and its cancellation; unit price has a median of £2.08 and a minimum of minus £11,062.06, a manual adjustment posting.

Table 4.1: Effect of each cleaning rule on the row count
StepRows remainingRows removed
Raw file541,909
Drop rows without a customer ID406,829135,080 (24.9%)
Drop cancellations (invoice number starting with C)397,9248,905
Drop non-positive quantity or price397,88440
Drop exact duplicate rows392,6925,192

The cleaned file has 392,692 rows, 18,532 invoices, 3,665 products and 4,338 customers, and a total revenue of £8.89 million, of which 82.0 percent is from the United Kingdom. The median line is 6 units at £1.95; the median invoice carries 15 distinct products and is worth £302.57, which confirms the repository's note that many customers are wholesalers. Per customer, the median recency is 51 days, the median frequency is 2 invoices and the median spend over the year is £668.57, but the distributions are extreme: the most frequent customer placed 209 invoices and the largest spent £280,206. Two figures shape everything that follows. 1,493 customers, 34.4 percent, placed exactly one invoice in the year. And the top 10 percent of customers by spend account for 61.4 percent of revenue.

Choosing the Number of Clusters

Table 4.2 gives inertia and the mean silhouette for every k from 2 to 8. Inertia falls monotonically, as it must, with no sharp elbow. The silhouette is highest at k = 2 (0.43), which simply splits active from inactive customers, and settles at 0.34 for k = 3 and k = 4 before drifting down. k = 4 was chosen over k = 3 because the fourth cluster separates recent light buyers from lapsed one-time buyers, two groups that call for different marketing, and the silhouette cost of doing so is nil.

Mean silhouette coefficient by number of clusters, k = 2 to 8

Mean silhouette coefficient by number of clusters, k = 2 to 8 Line chart of Silhouette across 7 points, from 2 to 8. The same figures are listed in the table below the chart. Silhouette 0 0.1 0.2 0.3 0.4 0.5 2 3 4 5 6 7 8
Chart data
Point Silhouette
2 0.43
3 0.34
4 0.34
5 0.32
6 0.31
7 0.31
8 0.3
The silhouette falls from 0.43 at k = 2 and is flat at 0.34 for k = 3 and k = 4; k = 4 was chosen because it separates the one-time buyers from the recent light buyers, which k = 3 merges. Source: Own analysis of Chen (2015)
Table 4.2: K-means on standardized log RFM, k = 2 to 8
kInertiaMean silhouette
26,483.60.43
34,869.50.34
43,938.60.34
53,296.70.32
62,855.50.31
72,548.80.31
82,336.30.30

A silhouette of 0.34 is moderate. The clusters are real but they overlap at the edges, which is expected when the three features are continuous and skewed rather than naturally grouped. It is not a result to oversell, and the marketing plan below treats segment membership as a probability rather than a label.

The Four Customer Segments

Table 4.3 profiles the four segments by median recency, frequency and spend, ordered by spend. The letters are assigned here for readability; k-means numbers its clusters arbitrarily.

Customers per RFM segment, k = 4

Customers per RFM segment, k = 4 Bar chart of 4 values, from A: core repeat buyers at 709 to D: lapsed one-time buyers at 1,617. The same figures are listed in the table below the chart. A: core repeat buyersB: establishedoccasional buyersC: recent light buyersD: lapsed one-timebuyers 709 1,173 839 1,617
Chart data
Item Value
A: core repeat buyers 709
B: established occasional buyers 1,173
C: recent light buyers 839
D: lapsed one-time buyers 1,617
Segment A is 16 percent of customers and 65 percent of revenue; segment D is 37 percent of customers and 6 percent of revenue. Source: Own analysis of Chen (2015)
Table 4.3: RFM segment profiles, k = 4 (medians per customer)
SegmentCustomersShare of customersRecency (days)InvoicesSpend (£)Share of revenue
A: core repeat buyers70916%8103,72365%
B: established occasional buyers1,17327%5541,34224%
C: recent light buyers83919%1724675%
D: lapsed one-time buyers1,61737%17712986%

Segment A: core repeat buyers. 709 customers whose median last purchase was 8 days before the end of the file, who placed a median of 10 invoices and spent a median of £3,723, with a mean of £8,113 because the largest wholesalers sit here. They are 16 percent of customers and £5.75 million, 65 percent, of revenue. The retailer's year depends on them.

Segment B: established occasional buyers. 1,173 customers, 27 percent, buying about four times a year at a median of £1,342, last seen a median of 55 days ago. They contribute 24 percent of revenue. The gap between their frequency and segment A's is the clearest growth opportunity in the data.

Segment C: recent light buyers. 839 customers, 19 percent, who bought recently (median 17 days) but only once or twice, for a median of £467. Five percent of revenue. Many will be new customers whose second order decides which of the other segments they join.

Segment D: lapsed one-time buyers. 1,617 customers, 37 percent, with one invoice, a median of £298, and a median of 177 days since it. Six percent of revenue. More than a third of the customer base bought once and did not return within the year.

One expected segment did not appear. The share of customers outside the United Kingdom is between 8 and 11 percent in every segment, so on RFM features alone an "international buyers" group does not exist: overseas customers behave like domestic ones of the same recency, frequency and spend. Geography would need to be added as a feature, or handled as a separate cut, to support any country-specific strategy.

Which Products Are Bought Together?

Across the 18,532 cleaned invoices, 333 product pairs appear together on at least 1 percent of invoices. The pairs bought together most often are all variants of one line: the pink polkadot and red retrospot jumbo bags share 546 invoices (support 2.95 percent, confidence 62.7 percent from pink to red, lift 7.3); the green and roses Regency teacups share 541 (confidence 78.3 percent, lift 18.5); the green and red Bakelike alarm clocks share 530 (lift 14.2). The lunch bag range fills the next three places.

Invoices carrying both products, top five pairs

Invoices carrying both products, top five pairs Bar chart of 5 values, from Lunch bag red retrospot + lunch bag suki design at 519 to Jumbo bag pink polkadot + jumbo bag red retrospot at 546. The same figures are listed in the table below the chart. Jumbo bag pink polkadot +jumbo bag red retrospotGreen Regency teacup +roses Regency teacupAlarm clock Bakelike green+ alarm clock Bakelike redLunch bag red retrospot +lunch bag pink polkadotLunch bag red retrospot +lunch bag suki design 546 541 530 523 519
Chart data
Item Value
Jumbo bag pink polkadot + jumbo bag red retrospot 546
Green Regency teacup + roses Regency teacup 541
Alarm clock Bakelike green + alarm clock Bakelike red 530
Lunch bag red retrospot + lunch bag pink polkadot 523
Lunch bag red retrospot + lunch bag suki design 519
Out of 18,532 cleaned invoices. Every pair is a color or pattern variant of the same line, which is what a gift wholesaler's basket looks like. Source: Own analysis of Chen (2015)
Table 4.4: Product pairs on the most invoices (support of at least 1 percent)
Product AProduct BInvoices with bothSupportConfidence A to BLift
Jumbo bag pink polkadotJumbo bag red retrospot5462.95%62.7%7.3
Green Regency teacup and saucerRoses Regency teacup and saucer5412.92%78.3%18.5
Alarm clock Bakelike greenAlarm clock Bakelike red5302.86%67.2%14.2
Lunch bag red retrospotLunch bag pink polkadot5232.82%40.6%8.1
Lunch bag red retrospotLunch bag suki design5192.80%40.3%7.2

Ranking by lift instead of count surfaces the strongest associations: the green and pink Regency tea plates appear together on 202 invoices, only 1.09 percent support, but with a lift of 61.9, and the Poppy's Playhouse bedroom, living room and kitchen sets have lifts between 43 and 48. The pattern is the same throughout: customers who buy one color or room of a range buy the others, which is the behavior of a shop owner filling a display rather than a consumer buying a gift. For a wholesaler-heavy customer base, the most valuable recommendation is the rest of the range.

How Did the Recommender Perform?

The time split left 224,036 rows for training and 168,656 for testing, with 1,952 customers active in both periods. Table 4.5 reports the three recommenders.

Precision@10 by recommender on the held-out period

Precision@10 by recommender on the held-out period Bar chart of 3 values, from Most popular overall (baseline) at 4.7% to Co-purchased with the customer's own basket at 7.2%. The same figures are listed in the table below the chart. Most popular overall(baseline)Most popular in thecustomer's RFM segmentCo-purchased with thecustomer's own basket 4.7% 5.1% 7.2%
Chart data
Item Value (%)
Most popular overall (baseline) 4.7%
Most popular in the customer's RFM segment 5.1%
Co-purchased with the customer's own basket 7.2%
1,952 customers active both before and after 1 September 2011, ten recommendations each. Co-purchase beats the most-popular baseline by 2.5 points and covers six times more of the catalog. Source: Own analysis of Chen (2015)
Table 4.5: Offline evaluation, ten recommendations per customer, 1,952 customers
RecommenderPrecision@10Recall@10Customers with at least one hitCatalog coverage
Most popular overall (baseline)4.7%1.3%32.2%1.8%
Most popular in the customer's RFM segment5.1%1.3%33.5%2.2%
Co-purchased with the customer's own basket7.2%2.2%40.4%11.9%

Three results stand out. First, the segment-popular recommender barely improves on the global baseline: 5.1 percent precision against 4.7 percent, and identical recall. Knowing a customer's RFM segment tells the retailer how much and how often they buy, not which products, so the segment lists are nearly the same bestsellers. Second, the co-purchase recommender is clearly better on every measure: precision@10 of 7.2 percent, recall of 2.2 percent, two customers in five receiving at least one product they went on to buy, and coverage of 11.9 percent of the catalog against 1.8 percent for the baseline. It recommends different things to different customers, which the popularity lists do not. Third, the absolute numbers are low. Seven in a hundred recommended products were bought in the next hundred days, which is normal for a catalog of 3,665 products and a test window in which a typical customer bought a few dozen lines, and it is why the comparison with the baseline matters more than the level.

Implications for Marketing Strategy

Segment A, core repeat buyers. Protect rather than promote. These 709 customers already order every few weeks, so the useful personalization is range completion: when a wholesaler orders one color of a line, show the others, which is exactly what the co-purchase recommender does. Any discount here is margin given away.

Segment B, established occasional buyers. The frequency gap between four invoices a year and segment A's ten is where a reminder cadence and a co-purchase recommendation in the order confirmation would earn the most. If a tenth of this segment, about 117 customers, moved from four invoices a year to ten at their median order value of about £335, revenue would rise by roughly £235,000, half of what segment C contributes in a year.

Segment C, recent light buyers. The second order is the objective. A follow-up within the median recency window of 17 days, carrying the products most co-purchased with their first basket, is the cheapest test of whether they are new wholesalers or one-off gift buyers.

Segment D, lapsed one-time buyers. A single reactivation message with the rest of the range they bought from, then stop. Six percent of revenue from 37 percent of customers does not justify a campaign, and repeated contact with customers who have not bought for six months is the profiling use most likely to be questioned under Article 22.

What the data does not support. No country-level strategy, because geography does not separate on these features; no claim about click-through or conversion, because the file has no impressions; and no price or discount recommendation, because unit prices in the file are the retailer's, not experiments.

Chapter 5: What Do the Results Mean, and What Are the Limits?

That transaction data alone supports a usable segmentation and a recommender that beats a bestseller list, and that the gain comes from what a customer bought rather than which segment they fall in. The limits are that the data is one retailer's year from 2010 to 2011 with no behavioral signals, the clusters overlap, and the evaluation measures prediction, not sales.

Discussion

The first research question asked how many segments the data supports. Four, with the caveat that the silhouette of 0.34 describes overlapping rather than crisp groups. The value of k-means here is that nothing was assumed: the retailer did not define the segments in advance, and the structure that emerged, a small high-value core producing two-thirds of revenue and a large lapsed tail producing almost none, is a property of the data rather than of the analyst's expectations. The absence of a geographic segment is a finding of its own, and one that any country-specific marketing recommendation for this retailer would have to answer.

The second question, which products are bought together, has an answer with a clear shape. Every strong pair is a variant of one range, and the strongest lifts, above 40, belong to matched sets. That is the signature of trade buyers, and it changes what personalization means for this retailer: less "customers like you bought" and more "you are missing the green one".

The third question is the central result. Segment membership added almost nothing to recommendation precision, while the customer's own basket, through item-to-item co-purchase, raised precision@10 by half over the baseline and coverage sixfold. That agrees with Linden, Smith and York (2003), whose argument for item-to-item filtering was that it scales and personalizes at the same time, and it suggests that for a small retailer the segmentation and the recommender should do different jobs: segments decide whom to contact and how often, the basket decides what to show.

The fourth question is answered in the marketing plan and its final paragraph: the data licenses range completion, a second-order follow-up and one reactivation attempt, and it licenses nothing about countries, clicks or prices.

Limitations and Future Research

Five limitations bear on how far these results generalize. The data is transactional only, so browsing, reviews and support interactions are absent, and the segmentation cannot see why a customer bought. The data is one year from one retailer, ending in December 2011, so any statement about current behavior is an extrapolation. The features are RFM only; adding product category or country would likely change the clusters, and the silhouette of 0.34 shows the current ones overlap. The recommender evaluation is offline: it shows that the co-purchase model predicts later purchases better than popularity does, not that showing those recommendations would have caused them, and the absolute precision of 7.2 percent is low. And the methods are the simplest in their class; matrix factorization (Koren, Bell and Volinsky, 2009) and neural collaborative filtering (He et al., 2017) were reviewed and not implemented.

Each limitation is a piece of future work. Repeat the segmentation on a current dataset with behavioral signals; add country and category to the feature set and re-test whether a geographic segment appears; run the co-purchase recommender live against a held-out control group to measure conversion rather than prediction; and compare it with a factorization model on the same time split.

Conclusion

This dissertation set out to test how far data mining on transaction data alone can support e-commerce personalization. On the Online Retail dataset, k-means on RFM features produced four segments in which 16 percent of customers generate 65 percent of revenue and 37 percent bought once and lapsed. Co-purchase mining showed that customers buy across a range rather than across the catalog. An item-to-item recommender built on those pairs predicted later purchases with a precision@10 of 7.2 percent against 4.7 percent for a bestseller list, while a segment-based recommender did not improve on the baseline.

The practical conclusion is that a small retailer does not need behavioral tracking or a deep model to personalize. It needs its own invoice table, a clear cleaning rule, an RFM segmentation to decide contact frequency, and a co-purchase table to decide what to show. The methodological conclusion is that an offline test against a most-popular baseline is the honest way to report such a system, and that click-through and conversion belong to a live experiment the dissertation did not run.

What a Marker Looks for in This Sample

Three things carry the marks in an empirical CS dissertation of this kind, and this sample is built around them. The method must be reproducible: the cleaning rules, the transform, the seed and the split date are all stated, so a reader with the public file gets the same tables. The results must be evaluated against a baseline, not against expectation: a 7.2 percent precision means nothing until it sits next to the 4.7 percent a bestseller list achieves. And the claims must not outrun the data: a transaction file cannot yield a click-through rate, so a dissertation that reports one has either used data it did not describe or invented the number, and an examiner will ask which. A weaker submission would have reported five neat clusters with a silhouette of 0.7 and a conversion uplift; the marker's first question would be where the code is.

Need help with a similar data mining or machine learning dissertation, from cleaning the dataset to writing up the evaluation? Message us on WhatsApp with the title, the word count and the submission date.

References

  • Adomavicius, G. and Tuzhilin, A. (2005) Toward the next generation of recommender systems: a survey of the state-of-the-art and possible extensions. IEEE Transactions on Knowledge and Data Engineering, 17(6), pp. 734–749. doi.org/10.1109/TKDE.2005.99
  • Agrawal, R., Imieliński, T. and Swami, A. (1993) Mining association rules between sets of items in large databases. Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data, pp. 207–216. doi.org/10.1145/170035.170072
  • Chen, D. (2015) Online Retail [Dataset]. UCI Machine Learning Repository. 541,909 instances, donated 5 November 2015, CC BY 4.0. archive.ics.uci.edu/dataset/352/online+retail, DOI 10.24432/C5BW33.
  • Chen, D., Sain, S.L. and Guo, K. (2012) Data mining for the online retail industry: a case study of RFM model-based customer segmentation using data mining. Journal of Database Marketing & Customer Strategy Management, 19(3), pp. 197–208. doi.org/10.1057/dbm.2012.17. Abstract at researchportal.lsbu.ac.uk.
  • Data Science Process Alliance (n.d.) What is CRISP DM? datascience-pm.com/crisp-dm-2
  • European Parliament and Council (2016) Regulation (EU) 2016/679 (General Data Protection Regulation), Article 22: automated individual decision-making, including profiling. gdpr-info.eu/art-22-gdpr
  • Fayyad, U., Piatetsky-Shapiro, G. and Smyth, P. (1996) From data mining to knowledge discovery in databases. AI Magazine, 17(3), p. 37. ojs.aaai.org
  • He, X., Liao, L., Zhang, H., Nie, L., Hu, X. and Chua, T.-S. (2017) Neural collaborative filtering. Proceedings of the 26th International Conference on World Wide Web, pp. 173–182. doi.org/10.1145/3038912.3052569. Preprint at arxiv.org/abs/1708.05031.
  • Herlocker, J.L., Konstan, J.A., Terveen, L.G. and Riedl, J.T. (2004) Evaluating collaborative filtering recommender systems. ACM Transactions on Information Systems, 22(1), pp. 5–53. doi.org/10.1145/963770.963772
  • Koren, Y., Bell, R. and Volinsky, C. (2009) Matrix factorization techniques for recommender systems. Computer, 42(8), pp. 30–37. doi.org/10.1109/MC.2009.263
  • Linden, G., Smith, B. and York, J. (2003) Amazon.com recommendations: item-to-item collaborative filtering. IEEE Internet Computing, 7(1), pp. 76–80. doi.org/10.1109/MIC.2003.1167344
  • Rousseeuw, P.J. (1987) Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, 20, pp. 53–65. doi.org/10.1016/0377-0427(87)90125-7
  • scikit-learn developers (2026a) KMeans, scikit-learn 1.9.1 documentation. scikit-learn.org
  • scikit-learn developers (2026b) silhouette_score, scikit-learn 1.9.1 documentation. scikit-learn.org

Related samples: computer science dissertation proposal sample, report on mobile cloud computing, and final project ideas for computer science students. The statistics coursework sample uses the same reproducible-script approach on a smaller UCI dataset, with hypothesis tests and a regression rather than clustering.

Frequently Asked Questions

How does data mining improve e-commerce personalization?

By turning transaction history into groups and predictions. Clustering separates customers who behave differently, association rules find products that sell together, and collaborative or content-based filtering predicts what an individual is likely to want next. The store then changes what it shows, rather than showing everyone the same page.

What do support, confidence and lift mean in basket analysis?

Support is the share of all invoices that contain both products. Confidence is the share of invoices containing product A that also contain product B. Lift is confidence divided by the base rate of B, so a lift of 1 means no association and a lift of 18 means B is eighteen times more likely to appear when A is in the basket.

What is RFM analysis?

RFM scores each customer on recency, frequency and monetary value: how recently they bought, how often, and how much they spent. The three figures are simple to compute from a transaction table and are the standard input features for customer segmentation, which is why they appear in almost every e-commerce clustering study.

Which dataset is used in this dissertation?

The Online Retail dataset: transactions from a UK-based online gift retailer between 1 December 2010 and 9 December 2011, 541,909 rows with invoice number, stock code, description, quantity, invoice date, unit price, customer ID and country. It was donated to the UCI Machine Learning Repository by Daqing Chen in 2015 under a CC BY 4.0 license.

How do you evaluate a recommendation system without click data?

Split the transactions by date, train on the earlier period and test on the later one. For each customer active in both, recommend ten products they had not bought and count how many they went on to buy. Report precision and recall at ten, the share of customers with at least one hit, and catalog coverage, always against a most-popular baseline.

WhatsApp