Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Machine Learning for Finnace & Accounting Level Three · Lesson 7 of 10

Module Six

📖 Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
7
Module 6: Audit Analytics & Anomaly-Based Sampling for Young Coders
⭐ Module 6 · Level Three

Audit Analytics &
Anomaly-Based Sampling

🔍 Using ML to find what auditors might miss

🎯 What you'll learn in this module

  • ✔ How to use ML for risk‑based audit sampling
  • ✔ How to test journal entries and apply Benford's law
  • ✔ How clustering segments transactions
  • ✔ How to spot unusual patterns in ledgers
  • ✔ Why explainability matters in audit findings
  • ✔ How to produce documented workpapers for ML models
📋
What Is Audit Analytics?
The Big Idea

Auditors check that financial records are correct. Traditionally, they picked a random sample — say, 100 transactions from 10,000 — and examined them. Random sampling gives a general sense of accuracy, but it can miss the risky ones.

Audit analytics uses data and ML to focus the sample on the riskiest items. Instead of examining 100 random transactions, you examine the 100 most suspicious. That's a much better use of an auditor's time.

🕵️ A detective doesn't interview random people at the train station — they interview the ones connected to the case. Audit analytics works the same way.
🎯
Risk‑Based Audit Sampling with ML
Sampling

Risk‑based sampling uses a model to score each transaction by "how likely is this to be interesting?" Then you sample the highest‑scoring ones.

Features the model might use: amount relative to peers, unusual timing (3 AM entry), unusual account combinations, manual override of a standard entry, or values just below a reporting threshold (a red flag that someone tried to hide something).

This is a game‑changer: auditors can find the real issues with far fewer examinations than random sampling.

🔦 A flashlight doesn't need to illuminate the whole room — just the dark corners where things hide.
📒
Journal Entry Testing
Technique

Journal entries are the raw records of every financial transaction. Auditors look for unusual journal entries — manual adjustments, entries made at odd hours, round numbers (like exactly $100,000), or entries posted by a single person without review.

ML can flag dozens of these patterns automatically. Combined with rules (like "posting after close of business"), it gives auditors a powerful starting point. Every flag is a candidate for investigation.

📖 A journal entry is like a diary entry. If someone scribbled "borrowed $1000, forgot to mention where it went" at 2 AM, you'd raise an eyebrow.
🔢
Benford's Law: The Probability of Digits
Statistics

Here's a wild fact: in naturally occurring financial data, the digit 1 appears as the first digit about 30% of the time. The digit 9 appears only about 5% of the time. This isn't a coincidence — it's Benford's law.

If a dataset deviates strongly from Benford's expected distribution, that's a clue something might be manipulated. Fraudsters often invent numbers that don't follow Benford's law. Auditors use this as a screening test — one signal among many.

First Digit Expected Frequency
1 30.1%
2 17.6%
3 12.5%
4 9.7%
9 4.6%
🎲 If a die rolled 1 half the time, you'd suspect it's weighted. Benford's law catches financial dice that are suspiciously rolled.
🔵
Clustering for Transaction Segmentation
ML Models

Clustering groups similar transactions together — without needing labels. K‑Means, DBSCAN, and hierarchical clustering find natural "families" of transactions in your data.

Auditors use this to understand the data first ("what kinds of transactions exist?") and then to spot outliers — transactions that don't fit any cluster, or that sit awkwardly between clusters. An outlier may be legitimate (a one‑off big deal) or suspicious (someone testing the system).

🐠 In a fish tank, clustering separates species. An unusual fish that doesn't fit any group stands out — that's the outlier.
🚩
Detecting Unusual Patterns in Ledgers
Detection

Some classic "red flags" in financial data:

Round numbers: genuine invoices rarely end in .00 — but fabricated ones often do.

Threshold dodging: many entries at $9,999 when the rule triggers at $10,000.

Weekend/holiday entries: legitimate business rarely posts on Sunday at 4 AM.

Just‑below‑average amounts: fraudsters sometimes avoid being flagged by keeping amounts just under scrutiny.

ML can learn each of these patterns and combine them into a single risk score per transaction.

🚨 Red flags are like a speed camera at 11 mph over. If you always drive at 10 mph over, the camera won't catch you — but the anomaly detector might.
📝
Explainability & ML Workpapers

Governance

In audit, an unexplained finding is worthless. If the model flags a transaction, the auditor must explain why in the workpapers — the official record of the audit. That's where SHAP, LIME, and feature attribution come in.

Every flag should come with: the top features driving the score, the model version and training date, and a plain‑English explanation ("this entry was flagged because the amount is 3x the typical size for this vendor, and it was posted at 2:47 AM on a Sunday"). That's what makes audit analytics defensible.

⚖️ In court, evidence must be explainable, not just "the computer said so." Same in audit — the auditor must show their reasoning.
⚠️ Remember: ML flags suspicion, not guilt. Anomalies often have innocent explanations (a big sales deal, a legitimate year‑end adjustment). Never punish or accuse based only on a model score — use it as a starting point for investigation.

🛠️ Hands-on activities (no boring stuff!)

1

Random vs. risk sample: Out of 50 mock transactions, 5 are suspicious (unusual time, big round number, etc.). You can only examine 10. Choose 10 randomly — how many suspicious ones did you find? Then choose 10 strategically — how many now?

2

Journal entry hunt: Look at 20 sample ledger entries. Circle any that seem unusual (odd timing, round number, wrong person, just below a threshold). Write one sentence per suspicious entry explaining why.

3

Benford's law test: Take 20 numbers from a real invoice (or make up 20 realistic numbers). Count how many start with each digit. Does it match Benford's expected distribution (30% for 1, 5% for 9)? What might explain a mismatch?

4

Cluster thinking: Imagine 30 transactions: 25 are small daily purchases, 3 are medium monthly bills, 2 are huge annual payments. Sketch three clusters. Now add a 31st transaction at $450 — which cluster does it belong to? What if it's ambiguous?

5

Explain a flag: Your model flags a $9,999 invoice from a new vendor posted at 6:30 AM Sunday. Write a 2‑sentence explanation for the workpaper: what's the flag, and what specifically triggered it?

6

Workpaper design: Design a page in a workpaper that documents one ML flag. What fields would you include? (e.g., transaction ID, score, top feature, reviewer, decision, follow‑up.) Sketch the layout.

🏆

By the end of this module, you'll be able to: apply risk‑based sampling, test journal entries with ML, use Benford's law for screening, cluster transactions to spot outliers, and produce well‑documented, explainable audit workpapers.

🏆 Get Certified

🔒

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

🎓 Sign Up to Get Certified
🛠️ Practice Tools
Hands-on simulators & labs - subscription required.
→
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
→