$ cat projects/discount-leverage.md

Discount Leverage

Discount personalisation as a bandit problem — 3rd place at a national hackathon

awarded Oct 2021 — Nov 2021 Development lead

at a glance

Result
3rd place overall
Competition
ABI AcademyHack Ambev (Beer Garage)
Category
Recommendation & Optimization Systems
Reported by
Public repository + finalist demo day

context

A national hackathon run by Ambev asking teams to solve a retail problem with real transaction data. We entered the Recommendation & Optimization category with the question that a discount programme actually has to answer.

the problem

Three questions, in order: who should receive a discount, how do you know it was used, and which discount pays for itself.

Standard segmentation answers none of them. A cluster tells you a customer resembles other customers; it does not tell you which offer to send, and it has no notion of whether the offer was worth sending.

approach

What was tried — and, where it applies, what it taught. The second half is the part that usually gets edited out, and the part that is actually useful.

    • Clustered historical transactions into buyer profiles, then modelled discount allocation as a multi-armed bandit: each offer is an arm, each conversion a reward, and a custom gain function balances the customer's discount against the platform's target metric.

    learned The framing is right: allocation is a sequential decision under uncertainty, not a classification problem.

    • Started with pure clustering as the recommendation mechanism.

    learned Segments looked sensible and were not actionable — the segment a customer belongs to does not say which discount to send them. That is what pushed the work toward bandits.

    • Used raw conversion as the reward signal.

    learned It over-weights offers that would have converted anyway, because the customer was going to buy regardless. The gain function had to be written to approximate incremental effect instead.

outcome

Competition result
3rd place overall
ABI AcademyHack Ambev, Nov 2021
Category
Recommendation & Optimization Systems
Deliverable
Working prototype + finalist demo day presentation

what I would do differently

The bandit framing held up; the exploration budget did not. With another month the first thing I would build is the counterfactual: an explicit control group per offer.

Without a control group you cannot separate "this discount worked" from "this customer was going to buy anyway" — and that distinction is the entire value of the system.

artifacts

Last reviewed against its sources. Back to top