<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sadiayusuf on Medium]]></title>
        <description><![CDATA[Stories by Sadiayusuf on Medium]]></description>
        <link>https://medium.com/@sadiayusuf23?source=rss-8222fcc0e2ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hC-Ib1XC9Vy2wacZTxuU_w.jpeg</url>
            <title>Stories by Sadiayusuf on Medium</title>
            <link>https://medium.com/@sadiayusuf23?source=rss-8222fcc0e2ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:40:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sadiayusuf23/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Cutoff Was a Formula. I Went Looking for It Anyway.]]></title>
            <link>https://thequantasticjournal.com/the-cutoff-was-a-formula-i-went-looking-for-it-anyway-073e73bd30f2?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/073e73bd30f2</guid>
            <category><![CDATA[alteryx-designer]]></category>
            <category><![CDATA[chartered-accountants]]></category>
            <category><![CDATA[credit-risk-modelling]]></category>
            <category><![CDATA[credit-risk]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 06:47:46 GMT</pubDate>
            <atom:updated>2026-08-17T06:47:46.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="The Cutoff Was a Formula. I Went Looking for It Anyway. A CA’s notes on building a credit scoring workflow in Alteryx — and discovering that the number everyone reports is the one you can least defend." src="https://cdn-images-1.medium.com/max/1024/1*lGrzPT_bQh7VRmxiJ0Fp8w.png" /></figure><h4>A CA’s notes on building a credit scoring workflow in Alteryx — and discovering that the number everyone reports is the one you can least defend.</h4><p>Iset out to build a credit scoring model and spent most of my time on things that weren’t the model.</p><p>That’s the honest summary. I’m a Chartered Accountant learning applied analytics, and I picked the German Credit dataset because it’s the standard worked example for this problem — 1,000 loan applications, twenty attributes, a flag for whether each one went bad. I expected to spend my time on algorithms. I ended up spending it on sampling design, cost conventions, and eventually on discovering that the central question I’d been trying to answer empirically had a closed-form solution I’d walked straight past.</p><figure><img alt="The complete workflow. Input and recoding on the left, three-way sampling and four candidate models through the centre, scoring and the threshold sweep on the right. Alteryx Designer 2026.2." src="https://cdn-images-1.medium.com/max/1024/1*d7RbgcAbGyNdnlbdeCgiuA.png" /><figcaption>The complete workflow. Input and recoding on the left, three-way sampling and four candidate models through the centre, scoring and the threshold sweep on the right. Alteryx Designer 2026.2.</figcaption></figure><h4>Methods</h4><p><strong>Data.</strong> German Credit , UCI Machine Learning Repository, obtained via Kaggle. 1,000 credit applications from a German regional bank, 1973–75. Twenty predictors, one binary label. Amounts are an exposure proxy. The UCI documentation records that the amount field is the result of a monotonic transformation, with the original values and the transformation itself unavailable. Ordering is preserved; magnitude is not. Cost totals below are therefore in illustrative weighted units, not currency.</p><p><strong>Two features of the sampling design constrain everything below.</strong> The 700 good / 300 bad split is <em>stratified</em> — the UCI documentation records that bad credits were deliberately over-represented relative to the source portfolio. Thirty percent is a design choice, not a default rate, and the population rate can’t be recovered from the file. Separately, “bad credit” is the bank’s own classification rather than a defined default event: no days-past-due threshold, no observation window, no treatment of cure. I use it because it’s what exists, but it isn’t the outcome a Basel or IFRS 9 model would be built on.</p><p><strong>Preprocessing.</strong> Auto Field for type inference. Two Formula tools recoding Account Balance and Payment Status from numeric codes to labels — code 1 on Account Balance means <em>no account held</em>, which is a different state from a low balance, and collapsing the two would change what the coefficients mean.</p><p><strong>Sampling.</strong> Create Samples at 60% estimation / 20% validation / 20% holdout. Oversample Field on the estimation branch only, targeting the minority class at 50%. Validation and holdout keep the file’s own 70/30 mix.</p><p><strong>Models.</strong> Logistic Regression, Decision Tree, Forest (200 trees) and Boosted, all at Alteryx defaults with no hyperparameter search, compared on validation via Model Comparison.</p><p><strong>Costs.</strong> Net margin 8%, LGD varied across 60/40/30%. Both are scenario inputs, not estimates from this portfolio — see Part 4.</p><p><strong>Not done.</strong> No calibration assessment, no hyperparameter tuning, no fairness testing, and the holdout is still sealed. Each is a real gap and I’ve said where it bites.</p><h4>Part 1: Splitting the data three ways, not two</h4><p>The instinct is to split into training and test, fit the models, and compare them on the test set. That’s what most walkthroughs do.</p><p>It has a problem, and it took me a while to see it.</p><p>I trained four models — Logistic Regression, Decision Tree, Forest, and Boosted. Then I compared all four on the same validation data and picked the winner. That final act, choosing based on what I saw, is what contaminates the comparison.</p><p>Think about what “best of four” means. Each model’s validation score is its true skill plus some luck of the draw from those particular records. When you take the maximum of four noisy numbers, you get something above the truth on average. Not because you did anything wrong — it’s just arithmetic.</p><p>So the split has to be three ways:</p><ul><li><strong>Estimation (60%)</strong> — trains the models</li><li><strong>Validation (20%)</strong> — used to compare and choose</li><li><strong>Holdout (20%)</strong> — untouched until every decision is locked, then opened once</li></ul><figure><img alt="Three-way split at 60/20/20, random seed 1. The H output is the anchor most walkthroughs leave dangling." src="https://cdn-images-1.medium.com/max/528/1*99VegW8QV2WSnJ0OFnmkxQ.png" /><figcaption>Three-way split at 60/20/20, random seed 1. The H output is the anchor most walkthroughs leave dangling.</figcaption></figure><p>The audit parallel is close enough to be useful: validation is your working papers, holdout is the sample you don’t touch until the file is closed.</p><p>If you work in Python, this discipline usually hides inside a function — cross-validation partitions the training data while a separate test set sits untouched. Alteryx does have a Cross-Validation tool, depending on version and licence, and the Decision Tree tool prunes using internal CV. But if you’re building the model comparison by hand, as I was, the middle split has to exist as a visible branch of the workflow. You can see it, which I’ve come to think is an advantage.</p><h4>Part 2: Where the oversampling sits, and what it can’t fix</h4><p>Thirty percent of the file is labelled bad. That’s imbalanced enough that a model can drift toward predicting “good” for everyone, so the standard move is to rebalance the training data.</p><p><strong>My first mistake was placement.</strong> I had Oversample Field sitting upstream of Create Samples. That rebalanced everything — training, validation and holdout all came out 50/50 — which meant my validation set described a population that doesn’t exist, and every metric I computed from it was measuring an invented world. The numbers looked perfectly reasonable. That’s what made it dangerous.</p><figure><img alt="Oversampling belongs on the estimation branch alone. Validation and holdout must keep the file’s own class mix, or every metric computed from them describes a population that doesn’t exist." src="https://cdn-images-1.medium.com/max/1024/1*BSyHNrnEn9V-1NrUBddjag.png" /><figcaption>Oversampling belongs on the estimation branch alone. Validation and holdout must keep the file’s own class mix, or every metric computed from them describes a population that doesn’t exist.</figcaption></figure><p>There’s a cost to rebalancing that’s worth naming. Alteryx’s Oversample Field reaches 50/50 by <em>discarding</em> majority records rather than duplicating minority ones, so my 600 estimation records became 358. On a file of 1,000, throwing away 240 rows isn’t trivial — and at a 30% minority rate it’s genuinely arguable whether the rebalancing earns its keep. I should have tested it both ways.</p><p><strong>The subtler problem is one no wiring change can fix.</strong> Rebalancing pushes predicted probabilities upward, and Alteryx’s Score tool has an “oversampled value” setting that rescales them back toward a stated base rate. I entered 30%.</p><p>That setting does exactly what it should — it undoes the rebalancing I introduced and returns the scores to the file’s own rate. What it can’t do is get to a <em>population</em> rate, because the file’s 30% is a stratified design in which bad credits were deliberately over-represented. No operation available in the workflow bridges that gap, because the information simply isn’t in the data.</p><p>The consequence shapes everything that follows: the scores show moderate discrimination on this validation split<strong>, but they aren’t default probabilities.</strong> Anything downstream that treats them as PDs — including the whole threshold analysis — inherits that. In a real build you’d re-anchor to an observed portfolio rate and the problem would disappear. Here it doesn’t, so I’ll keep flagging it.</p><h4>Part 3: Choosing a model, and what AUC doesn’t tell you</h4><p>The first thing to do with this table is ignore accuracy. A model that approves everyone scores 70% on this file by doing nothing at all, and accuracy silently fixes a 0.5 cutoff — which is precisely the assumption the rest of this article is about.</p><figure><img alt="Four models on the validation sample, n = 200 (approx. 140 good, 60 bad). Accuracy and per-class recall computed at the tool’s default 0.5 cutoff; AUC is threshold-independent." src="https://cdn-images-1.medium.com/max/1024/1*SdxbstiMvwpC6VckDd6nKQ.png" /><figcaption>Four models on the validation sample, n = 200 (approx. 140 good, 60 bad). Accuracy and per-class recall computed at the tool’s default 0.5 cutoff; AUC is threshold-independent.</figcaption></figure><p>The interesting row is the Decision Tree. It has the worst AUC (0.697) and by far the best recall for bad credits: it catches 84% of them, compared to 70% for the boosted model. On the face of it, that looks like a reason to prefer it.</p><p>It isn’t, and the reason took me a moment. Look at the tree’s accuracy on good credits: 0.556. It’s declining nearly half of them. It isn’t separating the two groups better — it’s just operating at a more conservative point. <strong>Recall isn’t a property of a model. It’s a property of the model and the cutoff together</strong>, and you can move one without touching the other.</p><p>It’s tempting to go one step further and say the boosted model could reach 84% recall while rejecting fewer good applicants, since its AUC is higher. That doesn’t follow. Higher AUC means one curve encloses more area overall; it doesn’t guarantee that curve sits above the other at every operating point, and ROC curves cross. The checkable version of the claim is narrower: <em>compare the two at the same recall, and the boosted model wins there only if its false-positive rate is lower at that specific point.</em> That’s a comparison worth running, and it belongs in the workflow rather than in a sentence.</p><p>There’s a bigger limitation to lean on AUC alone, though. It measures how well a model <em>ranks</em>, and says nothing about whether the numbers it produces are right in level. Part 5 goes on to treat scores as probabilities — and a model can rank beautifully while being systematically off. What would tell me are Brier score, log loss, and a calibration curve on validation, plus discrimination measured in the operating region I care about rather than across the whole curve. I have none of them. Given Part 2, calibration here may not be achievable at all, which is worth knowing before anyone builds on this.</p><p><strong>I chose the Logistic Regression at 0.750</strong>, against 0.766 for the boosted model. I won’t claim that gap is negligible without having measured the uncertainty around it — but Part 6 measures substantial split-to-split variation in a closely related quantity at this sample size, and it would be surprising if model ranking were stable where cutoff selection isn’t.</p><p>What does stand independent of the performance numbers is interpretability. Logistic regression gives you coefficients you can interrogate, and stated precisely they show <em>how the model associates loan term with predicted risk, conditional on the other variables</em>, with uncertainty attached. Not “longer terms cause higher risk” — this design can’t support that, since loan term is negotiated partly in response to the very risk it’s meant to explain.</p><p>I’d add that ensembles aren’t the black boxes they’re often described as. SHAP values, partial dependence and monotonicity constraints all make a boosted model interrogable, and monotonicity constraints in particular are what regulated lenders actually use in production. The real difference is narrower: a logistic model’s functional form is fixed and inspectable <em>before</em> you fit it, which shortens model-risk review. That’s a genuine advantage, and a more modest one than the usual framing suggests.</p><h4>Part 4: What each mistake costs</h4><p>The model produces a score. A bank has to lend or not lend. Something has to convert one into the other, and that something is a cutoff.</p><figure><img alt="Confusion Matrix" src="https://cdn-images-1.medium.com/max/1024/1*kr8SO2xRX1jUxzLSraGe9Q.png" /><figcaption>Confusion Matrix</figcaption></figure><p>The default is 0.5, and 0.5 carries an assumption nobody says out loud: that being wrong in either direction costs the same. In lending it plainly doesn’t. Decline a good customer and you forgo a margin. Approve one who defaults and you lose a large fraction of the principal.</p><p><strong>Three things to declare about the numbers I use from here.</strong></p><p>The dataset comes with its own cost matrix. UCI specifies <strong>5:1</strong> — misclassifying a bad credit as good costs five times the reverse error. I didn’t use it. I built my own scenario at 7.5:1, because I wanted costs weighted by actual loan amount rather than a flat ratio, and because I wanted to vary LGD and watch what happened. Departing from the supplied matrix is defensible; doing it silently isn’t, so I’m saying it here.</p><p>My inputs are illustrative, not estimates. An 8% coupon is not an 8% margin — funding cost, servicing, capital charge, origination expense and loan duration all sit between the two, and the net figure is usually a fraction of the headline rate. I have no source for either the margin or the LGD on this portfolio. Read every number downstream as a worked scenario.</p><p><strong>And my second mistake was in the cost matrix itself.</strong> I initially set the true negative at −8% (margin earned) and the false positive at +8% (margin forgone). Those are the same 8%, counted twice:</p><p>A decision rule only responds to the <em>difference</em> between the two actions, and declining a good customer costs 8% of the loan, not 16%. My nominal 7.5:1 ratio was actually operating at 3.75:1. Everything downstream inherited it.</p><p>The fix is to pick one convention and hold it. I use <strong>regret costs</strong>, measured against perfect foresight — correct decisions cost nothing, only mistakes carry a number:</p><p>FN (bad credit approved) = LGD × Amount<br>FP (good credit declined) = <em>m</em> × Amount<br>TN, TP = 0</p><figure><img alt="Regret cost formulation. There is no true-negative branch: a correct approval costs nothing, and the margin at stake is already captured by the false-positive branch." src="https://cdn-images-1.medium.com/max/491/1*0P-AJN9v2XSX1jgULdKObg.png" /><figcaption>Regret cost formulation. There is no true-negative branch: a correct approval costs nothing, and the margin at stake is already captured by the false-positive branch.</figcaption></figure><h4>Part 5: The cutoff is a closed form</h4><p>Here’s what I should have done before building any of it.</p><p>Take a single applicant with default probability <em>p</em> and loan amount <em>A</em>:</p><p><em>E</em>[regret | approve] = <em>p</em> · LGD · <em>A</em><br><em>E</em>[regret | decline] = (1−<em>p</em>) · <em>m</em> · <em>A</em></p><p>Approve when the first is smaller than the second:</p><p><em>p</em> · LGD &lt; (1−<em>p</em>) · <em>m</em><br><em>p</em> · (LGD + <em>m</em>) &lt; m</p><p><em>p</em>* = <em>m</em> / (<em>m</em> + LGD)</p><figure><img alt="Break-even cutoff p* = m/(m+LGD) across the LGD range, at three net margins. Markers show the three scenarios used here." src="https://cdn-images-1.medium.com/max/1024/1*LGM3qIkHuEhh5YEdt-xy8A.png" /><figcaption>Break-even cutoff p* = m/(m+LGD) across the LGD range, at three net margins. Markers show the three scenarios used here.</figcaption></figure><p>Two things fall straight out of that, and the first genuinely surprised me.</p><p><strong>The loan amount cancels.</strong> When both payoffs scale with exposure, <em>A</em> divides out and the optimal cutoff doesn’t depend on loan size at all. I’d assumed amount-weighting was central to the problem — it isn’t. Amount-weighting changes the total cost at any given cutoff, but it doesn’t move the optimum. Amount only re-enters when something in the economics <em>doesn’t</em> scale with it: a fixed origination cost, a capital charge with a floor, a collections process with a minimum spend. Those are real, and modelling them is the legitimate way back to caring about size.</p><p>And the answer, under my assumptions:</p><figure><img alt="Break-even cutoff p* = m/(m+LGD) at a net margin of 8%." src="https://cdn-images-1.medium.com/max/1024/1*GdroXz1s4mqpiObBxNsacg.png" /><figcaption>Break-even cutoff p* = m/(m+LGD) at a net margin of 8%.</figcaption></figure><p>Monotonic, and in the direction intuition gives once you see it: when each default costs you less, you can afford to approve more people.</p><p>Which means the grid search I’d spent a day building was estimating — badly, and with error bars I hadn’t computed — something available in one line of algebra.</p><p>The sweep isn’t wasted. It’s the right tool when costs genuinely vary by applicant in ways the formula can’t absorb, and it tells you the <em>cost of operating away from optimum</em>, which the formula doesn’t. But it should have been checked against the analytical answer rather than used in place of it. Derive first, then search, then reconcile.</p><h4>Part 6: What the search actually measured</h4><p>The search results move in the right direction — 0.08, 0.12, 0.12 as LGD falls, rising as theory says they should. But they sit consistently below the analytical values, and the gap widens: 0.04, then 0.05, then 0.09.</p><figure><img alt="Cost-minimising cutoff found by grid search (●) against the analytical optimum (│), single split, seed 1. Validation n = 200. Search grid 0.05–0.55 in steps of 0.01." src="https://cdn-images-1.medium.com/max/1024/1*M5u_Uo_YrbseIBc4bDB96A.png" /><figcaption>Cost-minimising cutoff found by grid search (●) against the analytical optimum (│), single split, seed 1. Validation n = 200. Search grid 0.05–0.55 in steps of 0.01.</figcaption></figure><p>Two explanations were available, with quite different implications. Either the scores aren’t calibrated — plausible, given Part 2 — so the optimal <em>score</em> cutoff needn’t equal the optimal <em>probability</em> cutoff. Or the search is simply too noisy at this sample size to locate anything at all.</p><p>Rather than pick one, I measured it. I re-ran the entire pipeline ten times at LGD 60% — sampling, rebalancing, model fitting, scoring, and the cutoff search — changing nothing except the random seed in Create Samples.</p><figure><img alt="Cost-minimising cutoff across ten random splits, everything held constant except the seed. Range 0.02–0.17, an 8.5-fold spread; standard deviation 0.050 against a mean of 0.078. The analytical optimum, 0.118, is marked in blue." src="https://cdn-images-1.medium.com/max/1024/1*AekcPgaS0663ZcqA0W1m9w.png" /><figcaption>Cost-minimising cutoff across ten random splits, everything held constant except the seed. Range 0.02–0.17, an 8.5-fold spread; standard deviation 0.050 against a mean of 0.078. The analytical optimum, 0.118, is marked in blue.</figcaption></figure><p>The cutoff ranged from <strong>0.02 to 0.17</strong>. An 8.5-fold spread, produced by nothing but which records happened to land in which split. Standard deviation 0.050 against a mean of 0.078. Seven of the ten splits landed below the analytical value and three above it.</p><p>The cost at each split’s own optimum ranged from 22,791 to 31,535 units— a 38% spread on a quantity I’d been quoting to two decimal places.</p><p>The ten-run diagnostic does not separate calibration error from sampling noise; it shows that split-to-split variation is large enough to obscure the difference in this dataset. With 200 records per validation split, no stable empirical cutoff emerged.</p><p>There’s a related trap I nearly fell into. Watching total cost fall as I lowered LGD across the three runs, it’s tempting to conclude that recovery rates drive the economics more than the cutoff does. But lowering LGD inside the cost formula <em>must</em> lower total cost — it multiplies the largest term. That’s arithmetic, not a finding. Ranking which input matters most would mean varying PD calibration, LGD, margin, EAD and volume together across plausible ranges, which is a different and larger exercise.</p><p><strong>And the resampling cost me something I hadn’t accounted for.</strong> The holdout was meant to be the honest test, but changing the seed in Create Samples repartitions the entire file — records sealed under seed 1 moved into estimation under later seeds and were fitted on. That’s a design error with a structural fix: reserve the test set once, before any resampling begins, and resample only within what’s left. Nesting them the wrong way round quietly consumes the thing you were protecting. Independent evaluation of these results now needs fresh data, which I don’t have. What above Figure shows still stands; what I can’t tell you is how any particular cutoff performs on data the pipeline has never seen.</p><h3>What I’m taking from this</h3><p>I did the work in the wrong order.</p><p>I started with the model, because that’s what “predictive analytics” sounds like it means. But the model turned out to be the most replaceable part of the build — swap the logistic regression for the boosted one and almost nothing downstream changes. What actually drove every number was the cost matrix, and I wrote that in ninety seconds without sourcing a single input.</p><p>Two things I’d carry into the next build. <strong>Derive before you search</strong> —derive the probability threshold before searching for its empirical score counterpart, and when the two disagree the disagreement is telling you something. <strong>Check whether your data supports the precision you’re about to report</strong> — I had a cutoff quoted to two decimal places before I checked whether a different random split would give me the same one. It wouldn’t, and ten runs is all that check cost.</p><p><strong>On IFRS 9 and Ind AS 109</strong>, there’s a connection here, though narrower than I first assumed. PD, LGD and EAD are common ECL inputs. But compliant measurement also requires probability-weighted outcomes across scenarios, discounting, forward-looking macroeconomic information, and the 12-month versus lifetime distinction by stage. This build illustrates one input, on a dataset that can’t calibrate it, under assumptions I invented. It isn’t a provision — and the distance between the two is most of the work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=073e73bd30f2" width="1" height="1" alt=""><hr><p><a href="https://thequantasticjournal.com/the-cutoff-was-a-formula-i-went-looking-for-it-anyway-073e73bd30f2">The Cutoff Was a Formula. I Went Looking for It Anyway.</a> was originally published in <a href="https://thequantasticjournal.com/">The Quantastic Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Years of Auditing Indian Businesses Taught Me the Exact Moment a Company Starts Dying — Before…]]></title>
            <link>https://medium.com/analysts-corner/7-years-of-auditing-indian-businesses-taught-me-the-exact-moment-a-company-starts-dying-before-b298aaaa34a0?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b298aaaa34a0</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[business-analysis]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 01:35:06 GMT</pubDate>
            <atom:updated>2026-08-07T01:35:29.234Z</atom:updated>
            <content:encoded><![CDATA[<h3>7 Years of Auditing Indian Businesses Taught Me the Exact Moment a Company Starts Dying — Before Anyone Else Knows</h3><h4>The warning signs are always visible. They are rarely seen.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rlDEV7hyLh3QKa8G34LCCw.png" /><figcaption>Revenue growth and cash collection diverging over 24 months. The top line still looks healthy; the business underneath it is not.</figcaption></figure><p>Most businesses don’t fail suddenly. They fail slowly — over eighteen to twenty-four months — in ways that are completely visible in their numbers long before anyone in the room admits it.</p><p>After seven years of statutory audit across some of India’s largest institutions and dozens of mid-sized businesses, I’ve sat in that room. I’ve seen the moment dozens of times. And it always looks the same.</p><p>I want to describe what it looks like — not because I think you’re about to fail, but because the warning signs I saw in other people’s businesses are the same ones founders almost never see in their own. Not because the signs are hidden. Because recognising what you’re looking at requires a perspective that is almost impossible to hold when you’re the one building the thing.</p><p>A statutory auditor is not a consultant. We are not brought in to help. We are brought in to verify — to examine the numbers without the benefit of the company’s narrative about them. That distance, which feels uncomfortable in the audit room, turns out to be the most valuable analytical tool I have ever had. It lets you see what the numbers are actually saying, rather than what the business needs them to say.</p><p>Here are eight patterns I watched play out, in businesses of every size, that signal a company is in serious trouble — usually long before the founders, the board, or the bank notices.</p><h3>Warning sign 1: The gap between invoiced revenue and collected cash starts quietly widening</h3><p>On paper, revenue is growing. The managing director walks into the audit meeting talking about a strong quarter. The top line looks healthy. But when you compare invoiced revenue to cash actually collected, there is a gap — and the gap is wider than it was last quarter, and wider than the quarter before that.</p><p>This is one of the earliest and most reliable signs I encountered. Businesses under pressure do not usually falsify their numbers outright. What they do is stretch the definition of when revenue is earned. A deal that closes in April gets booked in March. A project that is sixty percent complete gets recognised at eighty. The adjustments are always small enough to seem defensible and always large enough to matter.</p><p>The critical issue is not the accounting treatment. It is what the treatment reveals about the business. If your customers were paying you, you would not need to book the revenue early. The gap between what you have invoiced and what you have collected is a real-time measure of how far your commercial position has deteriorated — and it compounds. Next quarter, you need to stretch a little further to maintain the same appearance of growth.</p><p>Every founder I saw in this position believed they were buying time until things turned around. Some of them were right. Most of them were not.</p><p><em>If you run a business: look at this number every single month. Not your revenue — the gap between your revenue and your collections. The moment that gap starts growing, something in your commercial model has changed, and you need to know what it is before your auditor tells you.</em></p><h3>Warning sign 2: The working capital cycle starts stretching from both ends at once</h3><p>This one is slower and more insidious than the first. The headline numbers still look reasonable. Revenue is stable, perhaps even growing modestly. But in the balance sheet, something is quietly shifting.</p><p>Debtor days — how long customers take to pay — start creeping up. Forty-five becomes sixty becomes seventy-five. Simultaneously, creditor days — how long the company takes to pay its suppliers — also extend. Thirty becomes sixty becomes ninety.</p><p>Each change in isolation looks like a negotiation outcome. Customers are taking longer to pay; perhaps the market has softened. Suppliers are being paid later; perhaps the company is managing cash more efficiently. But when both move in the same direction at the same time, what you are actually watching is a business being squeezed on both sides of its cash cycle.</p><p>The business has less cash coming in than expected, and it is managing that shortage by delaying cash going out. That is not a strategy. That is a symptom.</p><p>The moment that stood out most clearly in my experience was never when these numbers crossed a particular threshold. It was when management could not explain why they were moving. “Customers are just taking a bit longer” is not an explanation. It tells you the business has lost some degree of control over its receivables — and that rarely reverses on its own.</p><p><em>The owners who caught this pattern early were the ones who treated the working capital cycle as a leading indicator rather than a trailing one. By the time it appears in your annual accounts, it has been true for months.</em></p><h3>Warning sign 3: Statutory dues start slipping</h3><p>For Indian businesses, I would put this near the top of the list, because it is almost impossible to argue with.</p><p>When cash gets tight, companies pay in a predictable order. Salaries first, because people leave. Critical suppliers second, because supply stops. Banks third, because default has consequences that arrive quickly. Statutory dues — provident fund, ESI, TDS, GST — come last, because the penalty is a percentage and the enforcement is slow.</p><p>So arrears in statutory dues are not primarily a compliance problem. They are a cash problem that has already worked its way down through every other priority. By the time TDS is being deposited late, the business has run out of softer options.</p><p>What made this signal so reliable in audit is that it is binary and dated. A debtor day calculation can be argued about. A challan is either deposited by the due date or it is not. And because reporting on arrears of statutory dues is a required part of the audit report, the information is already sitting in the public filings of every company that has this problem — visible to anyone who reads them.</p><p><em>The day you first choose to delay a statutory payment to manage cash, write the date down. Not because it is catastrophic on its own, but because if it happens again next quarter, you now have a trend — and trends in this particular number do not usually reverse quietly.</em></p><h3>Warning sign 4: The working capital limit is permanently fully drawn</h3><p>A cash credit or overdraft facility is designed to breathe. It is drawn down when working capital demands it and repaid when receivables come in. Utilisation should oscillate.</p><p>In businesses heading for trouble, it stops oscillating. The facility sits at or near its sanctioned limit month after month, and the monthly stock statements submitted to the bank start requiring noticeably more care to prepare than the books themselves.</p><p>What this means is that the overdraft has quietly stopped being a working capital facility and become permanent funding. The business is no longer using short-term credit to bridge a cycle. It is using it to finance an ongoing shortfall it has no mechanism to close.</p><p>The tell in the audit room was rarely the utilisation figure itself. It was the enhancement request. A business asking its bank to increase a limit that has never once come down is asking for a larger permanent loan while describing it as a working capital need.</p><h3>Warning sign 5: Related-party transactions increase as external credit quietly disappears</h3><p>This one requires some background. In Indian corporate audit, related-party transactions — loans from directors, advances from promoter entities, inter-company transfers within a group — are disclosed and examined carefully. They are not automatically a sign of wrongdoing. Most family-owned businesses use them routinely.</p><p>But the pattern I watched repeat across multiple engagements was this. A business that had historically funded its operations through bank credit and trade credit starts showing an increase in related-party borrowing. The amounts are disclosed. The documentation is in order. But when you look at the timing, the related-party borrowing rises precisely when external credit lines are not renewed, or when trade creditors begin enforcing stricter payment terms.</p><p>What that tells you is that the company’s external creditors — the banks, the suppliers, the institutions that extend credit on commercial assessment — have quietly revised their view of its creditworthiness. The business is now funding itself from its promoters’ personal resources because the market has stopped funding it on commercial terms.</p><p>The promoters are often the last to acknowledge this out loud. The numbers acknowledge it immediately.</p><p><em>If you have been operating for several years and your related-party borrowing is growing while your bank facilities shrink, it is worth asking one honest question: if someone who did not know you evaluated this business on its merits alone, would they lend to it?</em></p><h3>Warning sign 6: Inventory grows faster than revenue — and nothing gets written down</h3><p>In a healthy business, inventory and revenue move roughly together. When revenue is flat and inventory is climbing, the business is producing or purchasing goods the market is not absorbing.</p><p>That alone is a demand signal. What made it an audit signal was what came next: the provision for slow-moving and obsolete stock stayed exactly where it had always been.</p><p>This is the contradiction to look for. If inventory has aged, the provision should rise. When management explains that stock levels are up because of a deliberate decision to hold buffer, but simultaneously declines to increase the obsolescence provision, both statements cannot comfortably be true. Either the stock will sell — in which case, why hasn’t it — or it will not, in which case it is carried above its realisable value and the balance sheet is overstated.</p><p>The same logic applies to receivables. Debtor days rising while the bad debt provision percentage stays flat or falls is the same contradiction in a different account. Two numbers that should move together, moving apart, is one of the most dependable things an auditor watches for.</p><p><em>Strip out the judgement and ask the mechanical question: has anything on this balance sheet been written down in the last three years? If the answer is no, and the business has been under any pressure at all, the provisions are being managed rather than estimated.</em></p><h3>Warning sign 7: Small exceptional items appear every single year</h3><p>Exceptional items, in accounting, are charges or gains that are material and arise from events outside the ordinary course of business. A one-time restructuring charge. An asset impairment. A legal settlement. By definition, they are meant to be unusual.</p><p>In struggling businesses, they stop being unusual.</p><p>What I found, across multiple audit cycles with the same companies, was a pattern of recurring “one-off” charges. Each year brought a new exceptional item — a different category, a different justification, always presented as non-recurring. Taken individually, each was defensible. Taken together, across three or four years, they told a clear story: the business was generating recurring losses that it was classifying as exceptional in order to protect its reported operating performance.</p><p>The effect is that the headline profit number looks acceptable while the actual economic performance of the business is eroded, one “one-off” at a time.</p><p>This is harder to spot from inside the business, because each exceptional charge arrives with a legitimate narrative. The restructuring was necessary. The impairment was prudent. The settlement was unfortunate but isolated. All of that may be true. But if you look at your own financials over a three to five year period and find an exceptional item in every one of them, the items are not exceptional. They are the business.</p><p><em>The question to ask yourself is simple: strip out every item you have ever classified as non-recurring. What does the underlying profit number look like?</em></p><h3>Warning sign 8: Management’s language changes before the numbers do</h3><p>This is the one I trust most, because it is the earliest signal of all — and it has nothing to do with accounting.</p><p>In audit meetings you spend a great deal of time in conversation with management. You ask about specific balances, about movements, about provisions and estimates. Most of the time the responses are direct. Not always comfortable, but direct.</p><p>When a business is moving into trouble, the language changes in a way that is difficult to describe precisely and unmistakable once you have heard it enough times. Specific answers become general ones. A question about a particular debtor gets answered with commentary about the industry. A question about a provision gets answered with assurances about the future. Every concern is met with a response that is technically responsive and substantively empty.</p><p>The word “temporary” starts appearing frequently. “Timing difference” becomes a recurring phrase. Everything difficult is “one-off,” everything concerning is “being addressed,” every problem is something the business is “working through.”</p><p>I am not describing dishonesty. I am describing the language of people who have not yet accepted what their numbers are telling them — who are explaining their way past a reality they have not fully faced. I have sat with founders who were brilliant, hardworking and entirely sincere, who used this language not to mislead me but because they genuinely believed it.</p><p>The businesses that recovered were almost always the ones where, at some point in the conversation, management dropped the language and said something plainly true: this is what is wrong, this is how bad it is, this is what we are doing about it.</p><p><em>That shift — from the language of deflection to the language of specificity — was more predictive of recovery than any number I ever examined.</em></p><h3>What I actually took from seven years of this</h3><p>The most useful thing I took from seven years of audit is not a financial ratio or an analytical technique. It is a habit of looking at a business from the outside — as if I had no stake in what the numbers said, no narrative to protect, and no optimism about where things were headed.</p><p>That perspective is nearly impossible to hold when you are the founder. You are supposed to believe in the business. The optimism that makes you capable of building something is the same quality that makes you slow to see when it is failing.</p><p>But you can build some of that distance artificially. Once a quarter, look at your own numbers the way an auditor would. Not for validation. For evidence. Ask yourself: if someone who did not know me reviewed these numbers with no prior assumptions, what story would they read?</p><p>None of the warning signs I have described are sophisticated. They do not require an accountant to spot. They require only the willingness to look at what the numbers are actually saying, rather than what you need them to say.</p><p>That willingness, in my experience, is the rarest quality in a founder. And the most valuable one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b298aaaa34a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analysts-corner/7-years-of-auditing-indian-businesses-taught-me-the-exact-moment-a-company-starts-dying-before-b298aaaa34a0">7 Years of Auditing Indian Businesses Taught Me the Exact Moment a Company Starts Dying — Before…</a> was originally published in <a href="https://medium.com/analysts-corner">Analyst’s corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Detected Banking Transaction Anomalies Using Python —]]></title>
            <link>https://sadiayusuf23.medium.com/how-i-detected-banking-transaction-anomalies-using-python-fce7d3372926?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/fce7d3372926</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[chartered-accountants]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 12:05:10 GMT</pubDate>
            <atom:updated>2026-07-31T12:05:10.817Z</atom:updated>
            <content:encoded><![CDATA[<h4>And Why Audit Experience Caught What Statistics Missed</h4><p>Financial fraud in India costs billions every year. The challenge isn’t the absence of data — banks generate millions of transaction records daily. The challenge is knowing which number to distrust <em>before</em> the algorithm runs.</p><p>That’s not something data science courses teach. But seven years of statutory audit across India’s largest public institutions taught me exactly that.</p><p><strong>THE BUSINESS PROBLEM</strong></p><p>In banking, anomaly detection isn’t academic. A single undetected fraud pattern can cascade across a portfolio — small individually, catastrophic at scale. Standard rule-based systems flag obvious outliers but miss the structured manipulation that actually drives financial fraud: transactions <em>engineered to look normal</em>.</p><p>During my audit engagements, I encountered this repeatedly. Clusters of transactions sitting just below a regulatory reporting threshold. Velocity patterns that only emerged over a 72-hour window. Amounts that were statistically unremarkable — until you knew exactly which number they were designed to avoid crossing.</p><p>I built this anomaly detection system to encode those instincts into code. Three methods, each catching a different class of suspicious behaviour.</p><p><strong>Z-SCORE DETECTION</strong></p><p>Z-score analysis flags transactions where the amount deviates significantly from the population mean. For each transaction, the score measures how many standard deviations it sits from the mean — anything beyond ±3 is flagged for review.</p><p>Across a dataset of 200,000+ simulated banking transactions built on real SBI audit patterns, this flagged a <strong>3.2% outlier rate</strong> — consistent with BIS estimates for anomalous activity in emerging market banking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RzB1-R_qeQ-Pkmpxu0Lj1Q.png" /></figure><p>Z-score works well when your data is roughly normally distributed. Banking transaction data almost never is.</p><p>Real-world transaction amounts are heavily right-skewed — thousands of small everyday transactions, a handful of very large ones. When you calculate a Z-score on skewed data, the mean and standard deviation are pulled upward by the tail, making the method less sensitive to the genuine anomalies sitting at the lower end of the distribution.</p><p>The Interquartile Range method solves this. Instead of measuring deviation from the mean, it measures deviation from the middle 50% of your data — making it robust to the skewness that makes Z-score unreliable in financial datasets.</p><p>The logic: calculate Q1 (25th percentile) and Q3 (75th percentile). The IQR is the distance between them. Anything falling more than 1.5×IQR below Q1 or above Q3 is flagged as an outlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*EuYfdsGxb_h3ET5Mvrk97Q.png" /></figure><p>Where Z-score flagged 3.2% of transactions, IQR flagged 4.1% — and crucially, a different 4.1%. There was meaningful overlap, but each method surfaced cases the other missed.</p><p>This is the key point: no single detection method is complete. Z-score catches extreme high-value anomalies. IQR catches structural outliers across the full distribution. A bank’s fraud team runs both — not because of redundancy, but because financial fraud is not one thing.</p><p>An auditor learns this the same way: different analytical procedures exist because different types of misstatement require different tests. The same logic applies here.</p><p>The first two methods examine individual transaction amounts in isolation. Velocity checks examine behaviour over time — and that temporal dimension is where some of the most meaningful fraud patterns live.</p><p>Velocity, in fraud detection, refers to the frequency of transactions within a defined window. A single ₹4,00,000 transfer is unremarkable. Ten ₹4,00,000 transfers from the same account within 24 hours is a different matter entirely.</p><p>In my Audit work, velocity anomalies appeared most often in two scenarios: loan disbursement accounts with unusually high activity in the 48 hours before quarter-end, and dormant accounts that suddenly returned to high-frequency behaviour. Neither pattern was visible in a static snapshot of amounts. Both became immediately apparent when you looked at the data across time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Jr5qN4mocQFPDFRErrvQ3w.png" /></figure><p>The threshold of 10 transactions per day isn’t universal — it depends on the account type, business context, and the bank’s own baseline data. A current account for a small business might legitimately process 20 transactions daily. The same frequency on a savings account is a red flag.</p><p>This is where domain knowledge earns its place in the workflow. Setting the right threshold requires understanding what “normal” looks like for each account classification — something a fraud analyst with banking experience intuits, and something a model needs to be explicitly told.</p><p>In my dataset, velocity analysis flagged 2.8% of accounts — a small number, but disproportionately concentrated in account types where high frequency is genuinely anomalous.</p><p>After running Z-score, IQR, and velocity checks, I was satisfied that the three methods together formed a solid detection framework. Then I added a fourth check — not from a data science textbook, but from an audit procedure I’d applied dozens of times in the field.</p><p>In India, banking regulations require enhanced due diligence documentation for cash transactions above ₹10 lakh, and suspicious transaction reports for certain thresholds under PMLA. Experienced fraudsters know these thresholds. They structure transactions specifically to stay below them — a technique known as structuring, or “smurfing” — deliberately splitting amounts that would otherwise trigger reporting requirements.</p><p>A Z-score analysis will never catch structuring, because the individual transactions are statistically normal by design. The pattern only becomes visible when you look at frequency and proximity to the threshold simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bZgwqP56zX8KgIb4M_IaPw.png" /></figure><p>The results were striking. Near-threshold transactions accounted for just 1.1% of the total dataset — but when filtered to accounts with three or more such transactions, a clear</p><p>behavioural pattern emerged. These weren’t one-off large transfers. They were deliberate, repeated, and suspiciously consistent in their proximity to the reporting line.</p><p>This is the finding I couldn’t have surfaced without the CA background. A data scientist running anomaly detection on this dataset would have correctly flagged the Z-score and IQR outliers. They would likely have missed this — because knowing which threshold to look below requires knowing the regulatory framework, not just the data.</p><p>The intersection of domain knowledge and code is not a nice-to-have. It is where the most consequential findings live.</p><p>Bringing the three methods together produces a combined anomaly report — one view of every flagged transaction, its reason for flagging, and its account context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0nWAB98ujYLKVNcmoRSuGg.png" /></figure><p>Across 200,000+ transactions, the combined framework flagged approximately 6.4% of the portfolio for review — a workable number for a human analyst or a secondary ML model to investigate further.</p><p>Three takeaways from building this that I didn’t find in any data science course:</p><p>First, no single method is sufficient. Z-score, IQR, and velocity checks each catch a different class of behaviour. Running one and calling it done leaves meaningful risk undetected.</p><p>Second, thresholds are not universal. The right velocity threshold for a savings account is not the right threshold for a current account. Contextual calibration requires domain knowledge — not more data.</p><p>Third, the most dangerous patterns are the ones that look normal. Structuring is invisible to statistical anomaly detection precisely because it is designed to be. Catching it requires knowing what to look for before the query runs.</p><p>The full project — including the complete dataset and all detection methods — is available on GitHub.<em> Full project: </em><a href="https://github.com/sadia-yusuf/-Banking-Transaction-Analysis"><em>https://github.com/sadia-yusuf/-Banking-Transaction-Analysis</em></a></p><p><em>Sadia Yusuf, Chartered Accountant (ICAI) with 7+ years of statutory audit experience, now building financial risk analytics tools using Python and SQL</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fce7d3372926" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Python Scripts That Would Have Saved Me Weeks in Audit]]></title>
            <link>https://sadiayusuf23.medium.com/3-python-scripts-that-would-have-saved-me-weeks-in-audit-f062dc96b48a?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/f062dc96b48a</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[chartered-accountants]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 05:59:51 GMT</pubDate>
            <atom:updated>2026-07-20T05:59:51.116Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uI3fX1Yh7vb1cByphL0plw.jpeg" /></figure><p>Not tutorials. Just the exact code I wish had existed when I was doing this manually.</p><p>I spent years doing three specific tasks in audit that were slow, repetitive, and — I now know — completely automatable.</p><p>I’m not talking about the complex analytical judgements. I’m talking about the mechanical groundwork that had to happen before any of the interesting work could begin: reconciling datasets, finding duplicates, and producing aging analyses.</p><p>Here are the three scripts I would have used every single week.</p><p>① Reconciling two datasets from different systems</p><p>The audit version: export both datasets to Excel, manually align the columns, use VLOOKUP to find mismatches, spend an hour cleaning up formatting differences that make identical values look different.</p><p>The Python version:</p><p>What used to take an hour now runs in four seconds. The output is a clean dataframe of every item that doesn’t match across the two systems — ready to investigate, not to format.</p><p>② Duplicate transaction detection at period end</p><p>Year-end pressure creates a predictable anomaly in financial data: transactions posted more than once. The audit response was to call for a detailed listing and scan it manually. The Python response:</p><p>In seven years of audit, I never ran this check on a real financial dataset that returned zero rows. Not once. The duplicates were always there. The question was always how many and why.</p><p>③ Debtor aging analysis</p><p>Classifying outstanding balances into aging buckets — current, 30 days, 60 days, 90 days, 90+ — was one of the most time-consuming recurring tasks in any receivables audit. Here’s what it looks like in code:</p><p>These three scripts don’t replace audit judgement. They replace the mechanical groundwork that delayed it.</p><p>The question of whether a reconciling item is material, whether a duplicate reflects fraud or a system error, whether an aging balance is recoverable — those still require a trained professional to answer. Python just means you’re not spending three hours getting to the question.</p><p>If you’re in finance and curious about where code actually helps in real financial work — as opposed to where it’s interesting in theory — this is where it helps. In the plumbing. In the hours before the interesting work begins.</p><p>I’ll keep writing about this intersection. Follow if it’s useful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f062dc96b48a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Assumed Age Drove Customer Loyalty.]]></title>
            <link>https://medium.com/analysts-corner/we-assumed-age-drove-customer-loyalty-5e79e70c568e?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e79e70c568e</guid>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[business-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 04:09:57 GMT</pubDate>
            <atom:updated>2026-07-20T04:12:47.032Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>We Assumed Age Drove Customer Loyalty. A Regression Analysis of 2,000 Records Proved Us Wrong — and the Real Drivers Were Far More Useful</strong></h3><h4>What predictive analytics actually revealed about loyalty, segmentation, and the one spend threshold that changed the entire CRM strategy.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cszxeI__tduBaacHC4FAcw.png" /><figcaption>K-means clustering (K=5) validated by Elbow method and Silhouette scoring</figcaption></figure><p>Before the analysis began, the assumption in the room was the same one most businesses make about their customers: that loyalty is tied to who they are. Age. Gender. Education level. The demographic variables that appear in every CRM database and drive most segmentation decisions.</p><p>The data had a different answer.</p><p>After running regression models, K-means clustering, and NLP sentiment analysis across 2,000 customer records of a fictional UK-based gaming and toy retailer, two variables explained 82.7% of the variance in customer loyalty. Neither of them was of age. Neither was gender. One was how much customers spent. The other was how much they earned.</p><p>This article is about what that analysis revealed — and what it means for how analysts should approach loyalty modelling.</p><h3>The business problem</h3><p>The company wanted to understand what drove loyalty among its customer base and, more specifically, how to increase it. The dataset: 2,000 complete customer records including demographic data, transaction history, product reviews, and loyalty point balances.</p><p>The analytical brief covered four areas: identifying the key drivers of loyalty, segmenting the customer base into actionable groups, building a predictive model, and extracting sentiment from customer reviews. Standard enough. What wasn’t standard was what the data revealed once the analysis ran.</p><p>The mean loyalty score across the dataset was 1,578 points. The distribution, as we’d find out, was anything but uniform.</p><h3>Finding 1 — what doesn’t drive loyalty</h3><p>The first and most important finding wasn’t what drove loyalty. It was what didn’t.</p><p><strong>Age </strong>showed a Pearson correlation of r = −0.042 with loyalty points. Statistically, that is noise. A simple OLS regression of age against loyalty produced R² = 0.2% — the model explains almost nothing. Gender was similarly irrelevant: a t-test yielded p = 0.363, indicating thatmale and female customers showed no statistically significant difference in loyalty behaviour. Average points: 1,551 for male customers, 1,604 for female.</p><p><strong>Education </strong>was the one demographic that showed a significant effect — ANOVA returned F = 7.23, p &lt; 0.001 — but further analysis revealed it was functioning largely as a proxy for income. Remove pay from the model and education matters. Include pay and the effect largely disappears.</p><p>This has a direct implication for how the company should think about their loyalty campaigns: demographic targeting based on age or gender is not just ineffective — it is actively misdirecting marketing spend.</p><h3>Finding 2 — what actually does</h3><p>Spending behaviour and remuneration, on the other hand, were strongly predictive.</p><p><strong>Spend </strong>showed a Pearson correlation of r = 0.672 with loyalty — the strongest single relationship in the dataset. A simple OLS regression of spend against loyalty explained 45% of variance. After applying a log transformation to address heteroscedasticity (Breusch-Pagan p &lt; 0.001 flagged the issue in the linear model), R² rose to 52%.</p><p><strong>Remuneration </strong>(annual pay) showed r = 0.616 — meaningfully strong, though weaker than spend. Together, in a multiple linear regression with no multicollinearity concern (VIF = 1.00, confirming pay and spend are essentially independent variables), the model reached R² = 82.7%, validated on a 20% hold-out set at 81%.</p><p>The interaction model — adding a <strong>Pay × Spend</strong> term to capture the non-linear synergy between the two — pushed R² to 97.7%. The practical interpretation: high-pay and high-spend customers don’t just add to each other’s effect on loyalty. They amplify it. A high-income customer who also spends heavily generates loyalty at a rate that neither their income nor their spending alone would predict.</p><p>For analysts building loyalty models: this is the interaction effect that most simple regression frameworks miss. Testing for it — and finding it — is the difference between a model that explains 83% of variance and one that explains 98%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xDhdvX06hNhhAHLnlfEr9Q.png" /><figcaption>Customer segments with mean spend score</figcaption></figure><h3>The segmentation — K=5</h3><p>K-means clustering, validated by both the Elbow method and Silhouette scoring, identified five distinct customer segments. Each one told a different story about how loyalty actually distributes across a customer base.</p><p>The <strong>VIP </strong>segment — 18% of customers, mean loyalty 3,988 points — is the most critical group in the dataset. They generate disproportionate programme value and represent a significant concentration risk. The strategy for this group is straightforward: retain them with platinum-level treatment. Personalised rewards. Exclusive access. Proactive engagement before they show any sign of attrition.</p><p>The <strong>Growth </strong>segment is the largest: 39% of customers, mean loyalty 1,420 points. They are engaged and present, but haven’t crossed the spend threshold that would move them into the upper loyalty tier. The analytical task here is identifying what nudge moves them.</p><p>The most analytically interesting segment is what I’ve labelled <strong>Untapped </strong>— 13% of customers with mean annual pay of £74,800 but average spend of just 17. These are high-income customers who have not yet been activated by the product offering or marketing approach. If even half of them could be moved to spend like the VIP segment, the loyalty programme economics change substantially. The estimated CLV uplift if they behave like VIPs: 6.5×.</p><p>The <strong>Engaged </strong>segment (17%, loyalty 972) are lower-income but disproportionately loyal relative to their earnings — they over-index on commitment. The right strategy is not to try and extract more from them, but to protect what they’ve built. Value-based rewards. Tier preservation. Recognition that their loyalty isn’t conditional on income.</p><p>Finally, the <strong>Dormant </strong>segment: 14% of customers, mean loyalty just 275. The appropriate intervention here is automated and low-cost — a win-back sequence, not a high-touch campaign. The customer economics don’t justify a personalised approach at this loyalty level.</p><h3>The operational insight — spend = 67</h3><p>A pruned decision tree regressor (depth = 4, R² = 89%) identified the single most useful operational trigger in the dataset: a spend value of 67.</p><p>Below this threshold, mean loyalty sits at 1,432 points. Above it, mean loyalty jumps to 3,021+. The gap is not gradual — it’s a step change. This is a decision boundary, not a trend.</p><p>The practical implication is direct: customers in the 50–67 spend band are the highest-priority group for CRM intervention. A spend multiplier event, a targeted bundle offer, or a loyalty tier preview that makes the next level visible — any of these, applied to this cohort, has a measurable path to impact.</p><p>What makes this finding particularly useful is its operationality. An R² of 97.7% is an impressive model result, but you cannot translate an interaction coefficient into a daily marketing action. A spend threshold of 67 you can. Any analyst who has worked on the gap between model output and business action will recognise why this kind of finding is often the most valuable thing you produce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BZJlvmcW6H2oYXYOf8Fp3g.png" /></figure><h3>The risk no one was looking for</h3><p>An analysis brief focused on loyalty drivers doesn’t typically include a Gini coefficient. We included one because the distribution of loyalty points raised a question that the summary statistics didn’t answer: how concentrated is programme value?</p><p>The Gini coefficient for loyalty distribution came out at 0.415 — meaningful inequality. The top 25% of customers hold 54% of all loyalty points in the programme. If the top 200 customers churn, the programme loses approximately 30% of its total value.</p><p>This is a finding that belongs in a board presentation, not just an analytics report. A loyalty programme with a Gini of 0.415 has a structural vulnerability that pure acquisition metrics will never surface. You can grow your customer base every quarter and simultaneously increase your concentration risk if the growth is happening in the lower loyalty tiers.</p><p>The strategic implication is not to stop acquiring new customers. It’s to build retention mechanisms for the VIP segment that are proportionate to their actual value — and to understand that the entire programme’s economics rest on a group small enough to fit in a medium-sized meeting room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHFahvMf1rs5n1iE3F3Lgg.png" /></figure><h3>Takeaway for analysts</h3><p>Three things from this project that I’d carry into any loyalty or CRM analytics engagement:</p><p><strong>First, test the demographic assumptions before you build around them.</strong> Most loyalty frameworks start with demographic segmentation because demographic data is the easiest to collect and the most comfortable to present. The company’s data shows that demographic variables can be essentially irrelevant once you control for behavioural ones. Don’t wait until the model confirms this. Test it first.</p><p><strong>Second, look for the interaction effects. </strong>The jump from R² = 82.7% to R² = 97.7% came from a single additional term — the Pay × Spend interaction. Most standard regression setups don’t include interaction terms by default. The effort to test for them is minimal. The cost of missing them, in terms of model explanatory power, can be substantial.</p><p><strong>Third, find the operational threshold.</strong> The most technically impressive output of this project was the interaction model. The most useful output for the business was spend = 67. Every loyalty analysis should end with a number that a CRM team can act on tomorrow — not just a coefficient they need to translate.</p><p>The tools used across this project are Python (Pandas, Scikit-learn, NLTK, VADER), multiple regression, K-means clustering, decision tree regressor, and NLP sentiment analysis.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e79e70c568e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analysts-corner/we-assumed-age-drove-customer-loyalty-5e79e70c568e">We Assumed Age Drove Customer Loyalty.</a> was originally published in <a href="https://medium.com/analysts-corner">Analyst’s corner</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m Not a Career Changer. Stop Calling Me One.]]></title>
            <link>https://sadiayusuf23.medium.com/im-not-a-career-changer-stop-calling-me-one-ac791cc93b2b?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac791cc93b2b</guid>
            <category><![CDATA[changing-careers]]></category>
            <category><![CDATA[auditing]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[chartered-accountants]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 12:17:32 GMT</pubDate>
            <atom:updated>2026-07-16T12:17:32.472Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3ilYmSv3qpnCSG8exQ82g.jpeg" /></figure><p>The framing that holds finance professionals back from building analytical skills — and the one that actually works.</p><p>Every time I mention that I’m a Chartered Accountant learning Python and building data analytics projects, someone tells me I’m brave for making such a big career change.</p><p>I’m not making a career change. That framing — well-meaning as it is — is part of the reason more finance professionals don’t build analytical skills. It makes the whole thing sound like starting over. Like walking away from everything you already know.</p><p>What I’m actually doing is the opposite.</p><p>Seven years of statutory audit gave me something that no data science bootcamp or analytics programme can replicate: I know what financial data looks like when it’s lying to you.</p><p>Not through code. Not through a model. Through the kind of accumulated pattern recognition that only comes from sitting across a table from management teams who are hoping you won’t look too carefully at a specific line item — and looking carefully anyway.</p><p>I know why certain transaction patterns appear at quarter end. I know what a related-party disclosure that’s technically correct but structurally misleading looks like. I know the difference between a timing difference and a structural problem, and I know it before I’ve written a single line of Python.</p><p>That knowledge is the most valuable thing in a financial data analytics workflow. And it doesn’t come from analytics. It comes from audit.</p><p>What Python gave me was not a new career. It was a faster, more scalable way to act on what I already knew.</p><p>When I detect anomalies in banking transaction data using Z-score analysis and IQR, I’m not doing something separate from my audit work. I’m doing the same thing my audit work always trained me to do — identifying what doesn’t belong — at a scale and speed that manual processes can’t match.</p><p>When I build a customer segmentation model and find that age has essentially zero correlation with loyalty, I’m applying the same scepticism about assumptions that audit demands. The tool is different. The instinct is identical.</p><p>The “career change” framing implies that your existing experience is a sunk cost you’re walking away from. But for finance professionals moving into analytics, the existing experience is the competitive advantage.</p><p>A data analyst who learned Python first and finance second can build a clean model. A finance professional who learned Python second can build a clean model and tell you which assumptions in it are likely to be wrong — and why — before it runs.</p><p>That combination is not common. It’s not taught in any single programme. It takes time in both worlds, and most people only spend time in one.</p><p>I’m not starting over. I’m finishing a sentence that took seven years to set up.</p><p>If you’re a finance professional sitting on years of domain knowledge and wondering whether it’s “too late” to build technical skills — it’s not. And the framing that it requires starting over is wrong.</p><p>The domain knowledge doesn’t become irrelevant when you add technical skills. It becomes the thing that makes the technical skills unusually valuable.</p><p>That’s the intersection I write about here: what happens when audit experience meets data analytics, and why the combination produces something that neither world produces alone.</p><p>If that’s useful to you, follow along. There’s more coming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac791cc93b2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Audit Meeting That Made Me Learn Python]]></title>
            <link>https://sadiayusuf23.medium.com/the-audit-meeting-that-made-me-learn-python-6f2aa36c22fd?source=rss-8222fcc0e2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f2aa36c22fd</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[chartered-accountants]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Sadiayusuf]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 12:13:31 GMT</pubDate>
            <atom:updated>2026-07-16T12:13:31.977Z</atom:updated>
            <content:encoded><![CDATA[<p>It wasn’t a career plan. It was a frustration I couldn’t ignore any longer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*qvvLgDeha9shPDsjnCwuQA.jpeg" /></figure><p>Three years into my career as a statutory auditor, I sat in a meeting watching two senior team members spend four hours reconciling an inter-branch transaction report that should have taken twenty minutes.</p><p>The data was all there. It existed. It was just sitting in three different spreadsheets, formatted differently in each one, with no reliable way to merge them without going row by row.</p><p>I remember thinking: there has to be a better way to do this.</p><p>That thought sat in the back of my mind for another two years before I did anything about it.</p><p>By year five, I had worked across some of India’s most complex audit engagements — SBI, Delhi Metro Railway Corporation, BSES Yamuna Power. The scale of data involved in each one was significant. Loan portfolios with thousands of accounts. Transaction records spanning multiple branches and systems. Asset registers that hadn’t been fully reconciled in years.</p><p>And almost all of it was being handled the same way: manually, in Excel, by people who were very good at their jobs working much harder than they needed to.</p><p>The audit procedures themselves were sound. The professional scepticism, the verification processes, the materiality judgements — all of it was rigorous. But the underlying data work was slow in a way that felt unnecessary.</p><p>What I didn’t know then was that the gap between “data exists” and “data is usable” is exactly what Python is built to close.</p><p>I started learning Python the way most working professionals do — badly, at night, after long days, with too many browser tabs open.</p><p>The first time I wrote a script that merged two datasets, checked for duplicates, and flagged mismatches in under three seconds, I sat back and thought about all the hours I’d watched people do that by hand.</p><p>I didn’t feel clever. I felt slightly annoyed at myself for waiting so long.</p><p>What I was building wasn’t a new career. It was a better version of the work I already knew how to do. The audit instincts — the professional scepticism, the understanding of what “wrong” looks like in financial data, the knowledge of why certain numbers behave certain ways — those don’t come from a programming course. They come from years of sitting in rooms where the numbers have consequences.</p><p>Python just meant I could now act on those instincts faster, at a scale that manual processes couldn’t reach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GId6eIFEQOpYWWKOacmkiw.jpeg" /></figure><p>I’m writing this not because I think every CA should learn to code — though I do think more should consider it — but because I recognise the frustration that eventually pushed me to start.</p><p>If you’re a finance professional and you’ve ever watched a process take four hours that felt like it should take twenty minutes, that frustration is useful information. It’s telling you something about where the gap is.</p><p>I write here about what happens when audit experience meets data analytics — the things each world sees that the other misses, and why the combination turns out to be more useful than either alone.</p><p>If that intersection interests you, follow along.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f2aa36c22fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>