← Back to portfolio RFM Analysis of Bank Clients preview
Stack
PythonSQLTableau
Impact
  • Identified high-value customer segments
  • Optimized marketing campaigns
  • Improved retention efficiency
Source View on GitHub → Updated: Aug 21, 2026

RFM Analysis of Bank Clients

Context

The bank accumulates client transaction data, but marketing campaigns ran “flat”: the same offer for everyone. The task is to split the client base into homogeneous segments to personalize communication and concentrate resources on the most valuable clients.

Hypothesis

If we segment clients along three dimensions — Recency (when the last purchase happened), Frequency (operation count), and Monetary (total revenue) — we can surface groups with distinct behavior and build a separate retention and growth strategy for each.

Data & Method

Data: client transaction history, including operation date, amount, and transaction type.

Analysis steps:

  1. Cleaning & preparation — duplicates removed, missing values handled, relevant operation types selected.
  2. RFM metric calculation per client:
    • Recency: days since last transaction
    • Frequency: number of operations over the period
    • Monetary: total revenue from the client
  3. RFM-score clustering — each dimension scored, clients grouped into segments.
  4. Segment distribution visualization in Tableau with time and product filters.

Tools: Python (Pandas, Scikit-learn), SQL, Tableau.

Findings

Four key groups emerged:

  • High-value customers — recent, frequent, high-revenue clients. The main contribution to revenue.
  • Medium-value customers — moderate activity and revenue. Upsell growth potential.
  • Low-value customers — rare and low-revenue. Inefficient to invest in expensive channels.
  • At-risk customers — previously active but long inactive. Need reactivation.

Key insight: a small share of high-value clients generates a disproportionate share of revenue, while the at-risk segment decays faster than new-client inflow grows.

Impact

  • High-value segments identified — marketing got clear personas for targeting.
  • Campaigns optimized — budget reallocated toward high-value retention and at-risk reactivation.
  • Retention efficiency improved — teams moved from mass mailings to segmented scenarios.

Documentation

Charts

Source: github.com/NikitaBoyarkin/rfm-analysis-of-bank-clients: uv run python rfm_analysis.py on data/bank_rfm_dataset_10k_fixed.csv (10,000 synthetic transactions → 1,981 active clients); segment & revenue tables read from data/rfm_output.csv (re-run)

RFM segment sizes

Client count per RFM segment from the analysis of 10,000 bank transactions (1,981 active clients). Segments are derived from Recency/Frequency/Monetary quartile combos.

0 200 400 600 800 Чемпионы — Клиенты: 83 83 Лояльные — Клиенты: 311 311 Потенциально лояльные — Клиенты: 208 208 В зоне риска — Клиенты: 232 232 Нужно внимание — Клиенты: 395 395 Спящие — Клиенты: 752 752 Чемпионы Лояльные Потенциально лояльные В зоне риска Нужно внимание Спящие Segment Clients
Key takeaways
  • The largest segment is Hibernating: 752 of 1,981 clients (37.96%), nearly double Loyal (311, 15.70%).
  • Champions are the smallest: just 83 clients (4.19% of the base).
  • The three lower-value groups (Hibernating, Need Attention, At Risk) together cover 1,379 clients — 69.6% of the base.

Revenue share by RFM segment

Each segment's share of total client revenue. Concentration ratio = revenue share / client share: above 1 means the segment over-indexes on revenue.

0 10 20 30 Чемпионы — Доля выручки, %: 11.16 11.16 Лояльные — Доля выручки, %: 23.03 23.03 Потенциально лояльные — Доля выручки, %: 18.37 18.37 В зоне риска — Доля выручки, %: 16.79 16.79 Нужно внимание — Доля выручки, %: 6.99 6.99 Спящие — Доля выручки, %: 23.66 23.66 Чемпионы Лояльные Потенциально лояльные В зоне риска Нужно внимание Спящие Segment Revenue share, %
Key takeaways
  • Champions generate 11.16% of revenue with 4.19% of clients — a concentration ratio of 2.66, the strongest revenue over-index.
  • Hibernating holds the largest revenue share (23.66%) yet under-indexes: ratio 0.62 on a 37.96% client share.
  • The four segments below Champions together deliver 81.9% of total revenue.

Average monetary value by segment

Mean transaction sum per client within each segment. Shows how much value each segment contributes on average and who is worth upselling.

0 20000 40000 60000 80000 Чемпионы — Средняя ценность: 74641.22 74641.22 Лояльные — Средняя ценность: 41097.09 41097.09 Потенциально лояльные — Средняя ценность: 49029.62 49029.62 В зоне риска — Средняя ценность: 40172.47 40172.47 Нужно внимание — Средняя ценность: 9815.58 9815.58 Спящие — Средняя ценность: 17459.18 17459.18 Чемпионы Лояльные Потенциально лояльные В зоне риска Нужно внимание Спящие Segment Average monetary value
Key takeaways
  • Champions' average monetary value is 74,641 — 7.6× higher than Need Attention (9,816).
  • Potential Loyalists (49,030) are almost 20% richer than Loyal (41,097) despite lower purchase frequency.
  • Hibernating averages 17,459 — second lowest, justifying cheap win-back emails over expensive campaigns.

RFM score distribution

Client distribution by summed quartile score RFMScore (3 to 12, where 12 is best). Score = R_Quartile + F_Quartile + M_Quartile.

0 100 200 300 3 — Клиенты: 196 196 4 — Клиенты: 168 168 5 — Клиенты: 179 179 6 — Клиенты: 240 240 7 — Клиенты: 243 243 8 — Клиенты: 259 259 9 — Клиенты: 247 247 10 — Клиенты: 200 200 11 — Клиенты: 166 166 12 — Клиенты: 83 83 3 4 5 6 7 8 9 10 11 12 RFM score (sum of quartiles) Clients
Key takeaways
  • The distribution is nearly uniform: the peak at 8 points holds 259 clients (13.1% of the base).
  • The tail of 83 clients at the maximum of 12 points exactly matches the Champions segment.
  • The lowest score of 3 counts 196 clients (9.9%) — the core of Hibernating.

See also

Connection map

Projects, posts and topics connected to this one. Hover a node to see its name; click to open.