The IRP Ambitious Merchant Fund - £10,000 Replatform Credit
Notifications
You currently have no notifications!
The AMF Fund - £10,000 Credit
Search
Menu
Close Menu
✕
Built For Profit
Turn your ambition into success
Platform + Service Market
Contact Us
 *
Open
Menu
IRP Ecommerce Fundamentals (10)
Open
IRP Ecommerce Financial Secrets (5)
Open
Build, Manage & Grow (5)
Open
Marketing & Acquisition (11)
Open
Conversion & Retention (16)
Open
IRP Analytics & Reporting (1)
Open
IRP Research (13)
Open
IRP White Papers (6)
Close
Inspiration & Opinion (12)
Open
The IRP Platform (11)
Open
Inside the IRP Affinity Engine

The Maths of eCommerce Personalisation

Maths & Signals behind Purchase Intent
Author
25 November 2026 - 10 min read

IRP Commerce Engineering

The Maths of eCommerce Personalisation

IRP Affinity Engine turns customer behaviour into product signals

A product catalogue is the same for every customer. Its relevance is not. A customer who has spent months buying motorcycle clothing may arrive today looking for tyres. The challenge is to hold first party data and to recognise both the established preference and the immediate intent — and to turn that evidence into accurate recommendations.

IRP’s Customer Affinity Engine combines up to two years of customer behaviour, live browsing activity, directional product relationships, catalogue similarity and commercial availability. Rather than simply asking what other customers bought, it asks which products are most relevant to this customer, in this context, now.

One million customers = One million personalised product rankings. That is the purpose: Individual product offers at scale, rather than one universal list of bestsellers.

IRP Affinity EngineCustomersProducts
Figure 1. Conceptual view: each customer can have a different relationship with the same catalogue.

Reading the mathematics: The equations and numerical examples below explain the principles of the engine. Except where explicitly identified as an implemented setting, they are illustrative mathematical models, not a disclosure of the precise production algorithm or measured merchant results.

1. Turning behaviour into mathematical evidence

The engine evaluates browsing (including repeated views), completed purchases and positive product reviews. Purchases carry significantly more weight than browsing; positive reviews contribute according to their rating. Evidence is accumulated across four dimensions: individual products, brands, categories and brand–category combinations.

A(u, x) = N(Σ weighted behavioural evidence)

Here, u is the customer, x is the product or affinity dimension, and N normalises the resulting affinity to a 0–100 scale. This is a measure of interest, not a probability of purchase.

Recency. A recent interaction is generally more informative than one from many months ago. IRP applies six discrete recency weights: 1.0 for the first 7 days, 0.8 for days 8–30, 0.6 for days 31–90, 0.4 for days 91–180, 0.2 for days 181–365 and 0.1 for activity from day 366 up to two years old.

r(t) = { 1.0, 0.8, 0.6, 0.4, 0.2, 0.1 }   (by recency band)
Recency multiplier (%) 0 20 40 60 80 100 0 6 12 18 24 Age of interaction (months)
Figure 2. The six recency bands used by the IRP Customer Affinity Engine, shown as a stepped weighting function over two years.

Diminishing returns. Viewing a product ten times should provide stronger evidence than viewing it once, but not ten times the evidence. IRP uses square-root weighting so that repeated interactions contribute progressively smaller increments.

F(n) = √n
Relative signal strength 0 1 2 3 4 0 5 10 15 20 Repeated interactions
Figure 3. Square-root weighting used to moderate the contribution of repeated interactions.

For each event type within each recency band, the contribution is the event weight multiplied by its recency multiplier and the square root of the interaction count. These contributions are then accumulated before affinity normalisation.

Contribution = w × r × √n

2. Historical preference meets real-time intent

Historical affinity and current-session affinity are scored independently across the same four dimensions. This allows a customer’s immediate intent to influence recommendations without permanently rewriting their established preferences. Recent product views also seed related-product discovery immediately, rather than waiting for historical profiles to be rebuilt. Repeated session views strengthen the signal subject to diminishing returns.

AH(u, x) = historical affinity   |   AS(u, x, t) = session affinity
Historical affinityCurrent sessionMotorcycle clothing9218Motorcycle tyres1296Helmets658Accessories4225
Figure 4. Illustrative scores on a 0–100 scale: an established clothing customer is now exploring tyres.

3. A directional network of product relationships

Products are linked using customer purchasing behaviour and products viewed together in browsing sessions. Relationships are directional: the likelihood of finding a visor among helmet buyers can differ from the likelihood of finding a helmet among visor buyers.

P(B | A) = P(A ∩ B) / P(A)   ;   P(B | A) need not equal P(A | B)

Suppose 1,000 customers bought a helmet, 200 bought a visor and 150 bought both. Among helmet buyers, 15% bought a visor; among visor buyers, 75% bought a helmet. These are conditional frequencies, not evidence that one purchase caused the other.

Helmet: 1,000Visor: 20015% →← 75%150 bought both
Figure 5. Illustrative purchasing data demonstrating asymmetric relationships.

Confidence matters. A relationship supported by many observations should generally carry more weight than one supported by just a few. Purchasing relationships are prioritised over browsing relationships. IRP increases the evidence-confidence multiplier linearly up to 50 supporting observations, where it reaches its maximum of 1.0. This is a scoring adjustment, not a statistical confidence interval.

C(n) = min(1, n / 50)
Confidence multiplier (%) 0 25 50 75 100 0 25 50 75 100 Supporting observations
Figure 6. Relationship evidence confidence rises linearly to 100% at 50 supporting observations, then remains at its maximum.

Behavioural evidence is combined with catalogue similarity, which considers category hierarchy, brand and relative price. Catalogue similarity helps where behavioural evidence is limited. The IRP recommendation engine uses the following weighting:

Rij = 0.75 Bij + 0.25 Cij
75%25%Behavioural relevanceCatalogue similarity
Figure 7. The 75:25 weighting used by the IRP recommendation engine.

Up to 50 ranked relationships are retained for each product. The result is a sparse, directional product network: a practical way to discover relevant items without retaining every possible product pair.

4. Combining evidence into a personalised ranking

Recommendations draw on historical affinity, session affinity, related products from both sources, and brand, category and brand–category preferences. The engine combines evidence before considering availability and eligibility.

Q(u, p) = Σ wk xk(u, p)

In this conceptual model, each x is a relevance signal and each w is its weight. The score is a ranking value, not a calibrated probability.

Historical AffinitySession AffinityHistorical RelationshipsSession RelationshipsBrand / Category AffinityComposite RelevanceAvailability & Eligibility
Figure 8. Conceptual flow from behavioural evidence to commercially eligible recommendations.

Evidence can accumulate. If three source products independently point to the same candidate, their contributions can strengthen its rank. This supports discovery of products the customer has not previously viewed.

L(u, p) = Σj ∈ J(u) A(u, j) Rjp
Product A+24Product B+18Product C+12Product D: 54
Figure 9. Illustrative contributions of 24, 18 and 12 combine to strengthen a candidate score to 54.

Category hierarchy. A customer’s interest in helmets, protective equipment and motorcycle clothing can overlap. Instead of counting every matching level repeatedly, IRP uses the strongest relevant category match.

H(u, p) = max { AC(u, c) : c belongs to the category hierarchy of p }
Motorcycle Clothing — 45Protective Equipment — 68Helmets — 92max(45, 68, 92) = 92
Figure 10. Illustrative scores: select the strongest match, rather than adding overlapping category interests.

5. Relevance must meet commercial reality

A product can be relevant but unavailable or unsuitable for the customer’s shipping country. In-stock products receive priority, while longer expected delivery lead times progressively reduce scores. Country restrictions prevent recommendations where the brand or category cannot be supplied. Recently purchased products are also excluded to reduce unnecessary repetition.

S(u, p) = E(u, p) × V(p) × Q(u, p)

In this conceptual expression, E is a binary eligibility constraint, V is an availability adjustment and Q is the relevance score. An ineligible product is excluded from the candidate set, not merely ranked last.

In stock100Short lead time85Medium lead time60Long lead time30Country restricted0
Figure 11. Illustrative relative weights (out of 100), not production coefficients. Country restriction represents exclusion rather than a stock penalty.

Where insufficient personalised recommendations exist, the engine broadens its selection to products matching customer affinities and then to popular products based on recent sales. This keeps recommendations useful even for customers with limited or no history.

Personalised RecommendationsBroader Customer Affinity MatchesRecent Sales Popularity
Figure 12. Fallback hierarchy when there are insufficient personalised candidates.

6. The computational challenge of personalisation at scale

A merchant with one million customers and 100,000 products has a theoretical space of 100 billion customer–product combinations. Calculating and storing all possible scores is not necessary to produce useful recommendations.

1,000,000 × 100,000 = 100,000,000,000 (100 Billion)
100 billionPotential customer–product combinations
Figure 13. Conceptual illustration of scale, not a measured IRP deployment or a claim that every combination is materialised.

IRP uses precomputed product relationships and customer affinity profiles alongside in-memory recommendation caches. Historical profiles can be refreshed independently of relationship data; availability is maintained separately to accommodate more frequent stock changes. Session evidence is incorporated during the visit. The architecture supports both on-site personalisation and individualised marketing emails.

Historical Affinity ProfilesPrecomputed Product RelationshipsRecommendation EngineLive SessionStock & CountryOn-site RecommendationsIndividualised Emails
Figure 14. Conceptual architecture, showing separately maintained sources of evidence and the two supported output channels.

7. The next frontier: from relevance to profit

Relevance is a powerful starting point. But the commercial question is not simply which product a customer is most likely to buy. It is which relevant recommendation creates the greatest economic value.

The future direction for IRP ProfitOS is to combine calibrated purchase probabilities with Unit Net Profit (UNP). For a simplified single-unit purchase opportunity, expected profit could be represented as:

E[Π(u, p)] = P(purchase | u, p, recommendation) × UNP(p)
Illustrative example
Product Purchase Probability Unit Net Profit Expected Profit
A 20% £5 £1.00
B 15% £20 £3.00
C 10% £15 £1.50
Purchase Probability (%)Expected Profit (£)A20A1.00B15B3.00C10C1.50
Figure 15. Product A is most likely to convert, but Product B has three times its expected profit, under the simplified assumptions.

This is a future optimisation. Affinity scores first need to be translated into calibrated purchase probabilities. To measure the incremental profit caused by a recommendation, rather than purchases that would have happened anyway, controlled experiments would also be needed. Basket effects, returns and the relevant cost assumptions matter.

8. The result is Hyper-personlisation at Scale

The engine brings together what customers have purchased, what they have historically explored, what they are browsing now and what other customers’ behaviour reveals. It combines those signals with product availability to produce personalised recommendations that can respond in realtime.

The significance is not any one equation. It is the architecture that connects behavioural evidence, product relationships, live intent and commercial constraints into a practical ranking system — one that can serve both the storefront, emails, remarketing and individual customer experience.

The Customer Affinity Engine ships in IRP V9.10

One million customers = One million personalised product rankings

IRP ProfitOS — Intelligence Returns Profit 🎯

About the Author

William Bailie read Computer Science at the University of Oxford and is Chief Technology Officer at IRP Commerce. His research interests lie at the intersection of mathematics, statistics, artificial intelligence and trading, with a particular focus on applying quantitative methods to the analysis and optimisation of eCommerce trading performance.

- COMMENTS
Anonymous - Product Affinity represents a major milestone for IRP
25 Nov 2026 11:42
You must be logged in to comment on this article. Click here to Login to the IRP World
- MORE ARTICLES
Live Market Data
Today v Yesterday ↑0.03%
November 2026 v November 2025 ↑9.76%
YTD 2026 v 2025 ↑7.71%
Arts and Crafts ↑0.02%
Baby & Child ↑0.04%
Cars and Motorcycling ↓0.04%
Fashion Clothing & Accessories ↑0.04%
Food & Drink ↑0.60%
Health and Wellbeing ↓0.58%
Kitchen & Home Appliances ↓0.21%
Pet Care ↑0.11%
Sports and Recreation ↓0.00%
Toys, Games & Collectables ↑0.22%

Copyright © 2026 IRP Commerce. Use of this website constitutes acceptance of the IRP World Acceptable Use Policy, IRP World Terms of Use, IRP Privacy Policy and IRP Cookie Policy

IRP Commerce Limited, Concourse 1, Catalyst, BT3 9DT, UK. Company Number: NI 041856. VAT Number: GB 888249658
A Deloitte Fast 50 Company Eight times