BEGINNERAICHAPTER 06

AI in lending: what machine-learning credit models do that scorecards do not

A scorecard is a points table you can read aloud. A machine-learning model finds more, and costs you the ability to say why. Measure before you trust either

50 MINLENDING AND CREDITUPDATED 2026-11-14
PREDICT

In the lab you build a points table by hand from four bureau fields: the bureau score in bands, delinquencies in the last 12 months, enquiries in the last 90 days and years of credit history. You score Owoleaf's 372 approved loans and ask how well the points rank who later defaulted. How does the table do against the raw bureau score alone?

A model is a rule that turns what you know about an applicant into a number you can act on. Lenders have used simple ones for decades. Machine learning (ML) is a newer way of building the rule: instead of a person choosing the points, a program searches the lender’s past data for patterns that predict who repays. This chapter is about what that changes and what it costs. It does not train a model beyond a toy. Module 2 builds a scorecard properly, and how ML models work inside belongs to the AI Engineering course.

What a scorecard is

A scorecard is a table of attributes with points. Each answer an applicant gives earns some points, the points add up, and a cut-off turns the total into a decision. It looks like this (these are the points you use in the lab, chosen by eye and illustrative):

Attribute Answer Points
Bureau score 740 or more / 680–739 / 620–679 / below 620 60 / 40 / 20 / 0
No bureau score (a thin file) thin file 20
Delinquencies in the last 12 months none 20
Enquiries in the last 90 days 0–2 / 3–4 / 5 or more 20 / 10 / 0
Years of credit history 5 or more / 2–4 / under 2 20 / 10 / 0

A delinquency is a payment more than a stated number of days late. A thin file is a customer a bureau has little or no history for. The maximum here is 120 points, and a lender picks a cut-off, say 60, below which it declines.

A scorecard’s strength is that you can say why. A customer who got 55 points can be told exactly which rows cost them. A new analyst can audit every row. A regulator can read the whole model on one page. Its weakness is that it only sees what a person put in the table. It treats each attribute separately and adds them up, so it cannot say that three enquiries mean one thing for a customer with ten years of history and another for a customer with none.

Most real scorecards are not chosen by eye. They are fitted with a method called logistic regression, which finds the points that best separate good from bad borrowers in past data. Module 2 builds one. The form stays the same: a table you can read aloud.

What machine-learning models add

An ML credit model is usually a set of many small decision trees, each correcting the one before, a method called gradient boosting. You do not need the mechanism here. You need what it changes.

Non-linear patterns and interactions. A scorecard adds. An ML model can learn that a recent enquiry matters a lot when the loan is large and the history is short, and not at all otherwise. If those patterns are real and stable, the model ranks borrowers better.

Many features. A scorecard has a handful of attributes. An ML model can take hundreds: how often a wallet is topped up, how steady inflows are, the time of day of an application, the phone model. Owoleaf has some of these because it runs a wallet. A bank’s customer has bank-statement data; a telco’s customer has airtime history. Using data other than bureau data is called alternative data, and module 2 covers its limits.

Thin files. Where the bureau knows nothing, behaviour data may know something. In the lab, 84 of the 372 approved borrowers had thin files, and 12 of them (14.3%) went bad, against 24 of 288 (8.3%) with a bureau score. A lender that can say something about thin files can serve people a pure bureau rule leaves out.

None of this is free, and the gains are not guaranteed. A model that finds real patterns beats a scorecard. A model that finds patterns that were true only in last year’s data does not, and it looks excellent until the day it goes live.

What machine-learning models cost

Explainability. A customer, an examiner and your own collections team will all ask why. A scorecard answers by listing the rows. A tree ensemble answers with an approximation: tools such as SHAP estimate how much each feature pushed one score up or down. The estimate is useful and it is not the model itself. Some lenders therefore use ML only to find patterns and then write the findings back into a scorecard they can read. Others accept the approximation and document it.

Drift. The model learned from loans made in some months to customers who came through some channels. When the customers, the channels, the economy or the fraudsters change, the patterns shift and the model’s accuracy falls with no change to its code. Drift is that gap between the data the model learned from and the data it now sees. You watch for it by tracking the score’s distribution and the bad rate by score band every month. Module 3 teaches model risk in full.

Fairness. A model can use a feature that stands in for something it should not use. A phone model may stand in for income; a location may stand in for ethnicity or religion. Nobody typed in the sensitive attribute, and the model still learned it. Module 3 has a chapter on testing for this.

Governance. Someone has to own the model, validate it before use, record which version made which decision, review it on a schedule and be able to switch it off. A points table on one page costs little to govern. An ensemble of hundreds of trees from a vendor costs a team.

Selection bias, which both kinds suffer from. You can only learn from loans you made. Owoleaf’s lab rule declined 100 applications for a score below the cut-off. They have no repayment history, so nobody knows how they would have done. A model trained or tested only on approved loans has never seen them. The lab shows this: the lowest score among Owoleaf’s approved loans is 563 for BNPL (buy now, pay later), 581 for salary advances, 604 for SME loans and 634 for personal loans. The cut-offs are 560, 580, 600 and 620. No approved loan sits below its product’s cut-off, so a test on approved loans says nothing about what lies beneath it. Credit people call the fix reject inference: estimating how declined applicants would have behaved. It is an estimate, and it is on the module 3 list.

The vocabulary this course uses

Term Meaning
Feature One input to a model, such as enquiries in 90 days
Target What the model predicts, here whether a loan went bad
Bad The lab’s definition: status default or written_off at the cut-off, 2026-10-28
Score A number that ranks applicants by risk; higher means safer in this course
Cut-off The score below which the lender declines
AUC Chance that a random bad borrower scores worse than a random good one
In-sample and out-of-sample Tested on the data the model was built on, or on data it never saw
Overfitting A model that learned the noise in its training data and fails on new data
Drift The world moving away from the data the model learned from
Adverse action Declining a customer, or offering worse terms, because of a model

AUC deserves a worked example, because you compute it in the lab by counting pairs. In the lab data, 288 borrowers have a bureau score and 24 of them went bad. That is 24 bad and 264 good, so there are 24 × 264 = 6,336 pairs of one bad and one good borrower. For each pair you ask whether the good one has the higher score. Count one win for each pair where it does and half a win for a tie. The AUC is wins divided by pairs. The bureau score alone gets 0.751 and the points table 0.736.

Read those numbers with care. There are only 36 bad loans in the whole book. A small gap between two AUCs on 36 events is within the noise, and the lab data is generated, so the figures illustrate a method and do not say how any real model performs. A real validation uses thousands of loans and puts a range around the number.

What regulators and customers will ask

A customer who is declined asks why. A regulator asks whether a human can review the decision and whether the model treats groups fairly. Two sources set the tone.

In Nigeria, the Nigeria Data Protection Act 2023 has a section on automated decision-making. Section 37 gives a person the right not to be subject to a decision based solely on automated processing of personal data where it has a legal or similarly significant effect, with exceptions that commentators describe in slightly different words (the person’s consent, a legal requirement, a contract, or authority in a written law), and with safeguards where an automated decision is allowed, such as a way to ask for human involvement, give a view and contest the decisionas of 2026-11. This summary rests on commentary on the Act and on a copy of its text, not on a reading of the Gazette copy. Read the Act’s own text before you rely on a subsection letter. Whether a loan decision counts as one with a legal or similarly significant effect, and what counts as human involvement, are legal questions for the lender’s counsel and the regulator, not for this chapter.

Outside Nigeria, the European Union’s AI Act lists AI systems used to assess the creditworthiness of natural persons, or to set their credit scores, as high-risk, with a carve-out for systems used to detect financial fraudas of 2026-11. It does not bind a Nigerian lender, but it shows where the rules are heading and it binds vendors who sell into Europe. Sources disagree on when its obligations for these systems apply: law-firm commentary on a May 2026 political deal reports a postponement from August 2026 to 2 December 2027, while older pages still give August 2026. EUR-Lex lists an amending Regulation (EU) 2026/1744 in a consolidated version dated 27 July 2026, and this chapter has not checked what dates it sets. Read the consolidated text before quoting a date.

Whatever the law says, a lender should be ready to answer five questions.

  1. What does the model use? A list of features, with where each comes from and its consent basis.
  2. How was it tested? On whose data, over what period, and including applicants the old rule declined.
  3. Why this decision? A reason in plain words for each decline, drawn from the model’s actual drivers.
  4. Who owns it? A named person who signs the validation and can switch the model off.
  5. Is it fair? Results by group, and what you did when they differed.

Owoleaf and the vendor’s score

Back to Oyindamola and Sola. Oyindamola’s reply to the vendor lists what she needs: the feature list and its sources; the vendor’s own validation, labelled as the vendor’s claim; and a trial in which the vendor’s score runs silently next to Owoleaf’s rule for three months while Owoleaf’s rule keeps deciding. After three months Owoleaf will know how many of the applicants its rule declined would have repaid, which a test on approved loans cannot show. Sola builds the first comparison from the hand-made points table, because a new score that cannot beat a table anyone can read is not worth a team to govern it.

LAB Score the loan book with a points table, then check an AI's explanation of a decline ~45 MIN
YOU NEEDPython 3.9 or later, standard library onlylabs/finance/data/finance.sqlite from generate.py and loans.pyoptional: any free AI chat assistant, for step 5

You build a scorecard from four bureau fields, apply it to the approved loans and measure how well it ranks the ones that went bad. Then you test an AI assistant’s plain-words explanation of one decline. Work in labs/finance. Every figure and amount is illustrative.

1. Check the data and the outcomes. If data/finance.sqlite does not have the loan tables, run python3 generate.py && python3 loans.py && python3 check.py first. Then save this as outcomes.py.

import sqlite3
db = sqlite3.connect("data/finance.sqlite")
print("outcome of the 372 approved loans")
for status, n in db.execute("SELECT status, COUNT(*) FROM loans GROUP BY status ORDER BY 2 DESC"):
    print(f"  {status:<12}{n:>4}")
print("lowest bureau score among approved loans, by product")
for row in db.execute("""SELECT l.product, COUNT(*), MIN(b.score), SUM(b.hit = 0)
    FROM loans l JOIN applications a ON a.id = l.application_id
    JOIN bureau_reports b ON b.id = a.bureau_report_id GROUP BY l.product ORDER BY l.product"""):
    print("  product %s: %d loans, lowest score %s, thin files %d" % row)
print("declined for score below cut-off:",
      db.execute("SELECT COUNT(*) FROM applications WHERE decline_reason='score_below_cutoff'").fetchone()[0])
python3 outcomes.py
outcome of the 372 approved loans
  closed       288
  current       40
  default       34
  arrears        8
  written_off    2
lowest bureau score among approved loans, by product
  product BNPL: 85 loans, lowest score 563, thin files 19
  product PL: 52 loans, lowest score 634, thin files 12
  product SAL: 190 loans, lowest score 581, thin files 53
  product SME: 45 loans, lowest score 604, thin files 0
declined for score below cut-off: 100

You define bad as default plus written_off: 34 + 2 = 36 of 372. The lowest scores sit only a little above each product’s cut-off (560, 580, 600 and 620), and the 100 applicants below the cut-off have no loans, so no outcomes. Everything you measure next is blind to them.

2. Build and apply the scorecard. Save this as scorecard.py. It joins each approved loan to the bureau report its application used, adds up the points, groups loans into bands and computes AUC by counting pairs.

import sqlite3

BAD = ("default", "written_off")

def points(r):
    """A hand-made points table. ILLUSTRATIVE: chosen by eye, not fitted."""
    p = 0
    if r["hit"] == 0:
        p += 20                      # thin file: a middle score, no evidence either way
    elif r["score"] >= 740: p += 60
    elif r["score"] >= 680: p += 40
    elif r["score"] >= 620: p += 20
    if r["delinquent_12m"] == 0: p += 20
    if r["enquiries_90d"] <= 2: p += 20
    elif r["enquiries_90d"] <= 4: p += 10
    if r["history_years"] >= 5: p += 20
    elif r["history_years"] >= 2: p += 10
    return p

def auc(pairs):
    """pairs: (value, is_bad). Chance that a random bad scores LOWER than a random good."""
    bads = [v for v, b in pairs if b]
    goods = [v for v, b in pairs if not b]
    wins = sum((g > b) + 0.5 * (g == b) for b in bads for g in goods)
    return wins / (len(bads) * len(goods))

db = sqlite3.connect("data/finance.sqlite")
db.row_factory = sqlite3.Row
rows = db.execute("""
    SELECT l.id, l.status, b.hit, b.score, b.delinquent_12m, b.enquiries_90d, b.history_years
    FROM loans l
    JOIN applications a ON a.id = l.application_id
    JOIN bureau_reports b ON b.id = a.bureau_report_id""").fetchall()

scored = [(points(r), r["status"] in BAD, r) for r in rows]
print("loans", len(scored), "bad", sum(b for _, b, _ in scored))
for lo, hi in [(0, 40), (40, 60), (60, 80), (80, 100), (100, 121)]:
    band = [b for p, b, _ in scored if lo <= p < hi]
    if band:
        print(f"points {lo:>3}-{hi-1:<3} loans {len(band):>3}  bad {sum(band):>2}  bad rate {sum(band)/len(band):6.1%}")
print("scorecard AUC, all loans:", round(auc([(p, b) for p, b, _ in scored]), 3))
hits = [(r["score"], b) for _, b, r in scored if r["hit"]]
hits_card = [(p, b) for p, b, r in scored if r["hit"]]
print("hits only, n =", len(hits))
print("  bureau score alone AUC:", round(auc(hits), 3))
print("  scorecard AUC         :", round(auc(hits_card), 3))
python3 scorecard.py
loans 372 bad 36
points   0-39  loans  24  bad  4  bad rate  16.7%
points  40-59  loans  36  bad  8  bad rate  22.2%
points  60-79  loans 139  bad 17  bad rate  12.2%
points  80-99  loans  76  bad  6  bad rate   7.9%
points 100-120 loans  97  bad  1  bad rate   1.0%
scorecard AUC, all loans: 0.706
hits only, n = 288
  bureau score alone AUC: 0.751
  scorecard AUC         : 0.736

The top band (100 points and over) has a 1.0% bad rate against 12.2% in the middle band, so the table ranks well at the top. The bottom two bands are out of order: 22.2% for 40–59 points but 16.7% for under 40. With 24 and 36 loans in those bands, a few loans move the rate by several points, so you cannot tell whether that is noise or a flaw in the table. Against the raw score on the 288 borrowers who have one, your table is slightly worse (0.736 against 0.751), as the Predict suggested. The figures are in-sample: you chose the bands after looking at the data, so an honest test would use loans the table never saw, and 36 bad loans are too few to split.

3. Count the pairs yourself. Check one AUC by hand to see what it measures.

python3 -c "print(24 * 264, 'pairs of one bad and one good among the 288 borrowers with a score')"
6336 pairs of one bad and one good among the 288 borrowers with a score

The bureau score’s AUC of 0.751 means it ranks the good borrower higher in about 4,758 of those 6,336 pairs (0.751 × 6,336), counting ties as half. You can confirm 24 and 264 with the hit counts in step 2: 288 hits, of which 24 are bad.

4. Break it: change what counts as bad. In scorecard.py, change the line BAD = ("default", "written_off") near the top to BAD = ("default", "written_off", "arrears") and rerun.

Eight loans are in arrears at the cut-off and are not defaults yet, so the original definition counted them as good. Counting them as bad raises the bad loans from 36 to 44 and the figures move:

loans 372 bad 44
points   0-39  loans  24  bad  4  bad rate  16.7%
points  40-59  loans  36  bad  9  bad rate  25.0%
points  60-79  loans 139  bad 20  bad rate  14.4%
points  80-99  loans  76  bad 10  bad rate  13.2%
points 100-120 loans  97  bad  1  bad rate   1.0%
scorecard AUC, all loans: 0.684
hits only, n = 288
  bureau score alone AUC: 0.732
  scorecard AUC         : 0.714

Both AUCs fall, and the 80–99 band’s bad rate jumps from 7.9% to 13.2%. The model did not change: the definition of bad did. A vendor’s claim comes with its own definition of bad, so ask what it is and how long the loans had to mature.

5. Check an AI’s explanation of a decline. Save this as decline_prompt.py. It reads application 12, a ₦39,000 salary advance declined for a score below the cut-off, and prints a prompt. Use any first name for the customer.

import sqlite3, sys

APP_ID = 12
CUTOFF = {"SAL": 580, "PL": 620, "BNPL": 560, "SME": 600}   # the lab's illustrative cut-offs
name = sys.argv[1] if len(sys.argv) > 1 else "Sola"

def naira(kobo):
    return f"₦{kobo // 100:,}"          # whole naira only; integer arithmetic, no float

db = sqlite3.connect("data/finance.sqlite")
db.row_factory = sqlite3.Row
r = db.execute("""SELECT a.product, a.requested_kobo, a.decline_reason, b.score,
                         b.delinquent_12m, b.enquiries_90d, b.history_years
                  FROM applications a JOIN bureau_reports b ON b.id = a.bureau_report_id
                  WHERE a.id = ?""", (APP_ID,)).fetchone()
facts = (f"Customer: {name}. Product: {r['product']} (salary advance). "
         f"Amount asked: {naira(r['requested_kobo'])}. Decision: declined. "
         f"Reason code: {r['decline_reason']}. Bureau score: {r['score']}; "
         f"the lender's cut-off for this product: {CUTOFF[r['product']]}.")
print(facts)
print()
print("PROMPT TO PASTE INTO AN ASSISTANT:")
print("Write a short, kind message in plain English telling this customer why their "
      "application was declined, using only these facts. Do not add reasons or "
      "figures that are not listed.\n" + facts)
python3 decline_prompt.py Sola
Customer: Sola. Product: SAL (salary advance). Amount asked: ₦39,000. Decision: declined. Reason code: score_below_cutoff. Bureau score: 556; the lender's cut-off for this product: 580.

PROMPT TO PASTE INTO AN ASSISTANT:
Write a short, kind message in plain English telling this customer why their application was declined, using only these facts. Do not add reasons or figures that are not listed.
Customer: Sola. Product: SAL (salary advance). Amount asked: ₦39,000. Decision: declined. Reason code: score_below_cutoff. Bureau score: 556; the lender's cut-off for this product: 580.

The reason is one fact: 556 is below 580. A good explanation says that and nothing else.

Paste the prompt into a free assistant and save its reply as reply.txt. Your reply will differ from anyone else’s. Now save this checker as check_reply.py. It reads money written the Nigerian ways (₦39,000, N39,000, NGN 39,000, ₦1.5k, 15k), converts each amount to integer kobo with Decimal, and compares it with the one amount in the facts.

import re, sys
from decimal import Decimal

ALLOWED_KOBO = {3_900_000}            # the only money amount in the facts: ₦39,000
ALLOWED_NUMBERS = {"556", "580"}      # score and cut-off

# money written the Nigerian ways: ₦39,000  N39,000  NGN 39,000  ₦39k  ₦1.5k  and a bare 39k
MONEY = re.compile(r"(?:(?:₦|NGN|N)\s?)?(\d[\d,]*(?:\.\d+)?)\s?(k\b)?", re.I)

def to_kobo(text, k):
    value = Decimal(text.replace(",", ""))
    if k:
        value *= 1000
    return int(value * 100)           # Decimal, then an integer count of kobo

reply = open(sys.argv[1], encoding="utf-8").read()
problems = []
PATTERN = re.compile(r"(?:₦|(?<![A-Za-z])(?:NGN|N))\s?\d[\d,]*(?:\.\d+)?(?:\s?k\b)?|\b\d+(?:\.\d+)?k\b", re.I)
for m in PATTERN.finditer(reply):
    num = MONEY.match(m.group(0))
    kobo = to_kobo(num.group(1), num.group(2))
    ok = kobo in ALLOWED_KOBO
    print(f"money {m.group(0)!r:12} -> {kobo:>9} kobo  {'ok' if ok else 'NOT IN THE FACTS'}")
    if not ok:
        problems.append(m.group(0))
rest = PATTERN.sub(" ", reply)          # money is checked above; look at the other numbers
for n in sorted(set(re.findall(r"\b\d{3}\b", rest))):
    if n not in ALLOWED_NUMBERS:
        print(f"number {n}: NOT IN THE FACTS"); problems.append(n)
for word in ["late payment", "missed", "BVN", "income", "fraud", "appeal"]:
    if word.lower() in reply.lower():
        print(f"claim to check: the reply mentions {word!r}")
print("PASS" if not problems else f"CHECK {len(problems)} problem(s)")
python3 check_reply.py reply.txt

To see both outcomes without an assistant, save these two replies that we wrote to show the checker (they are not from a real assistant). reply_good.txt:

Hello Sola, we could not approve your ₦39,000 salary advance this time. The credit score we received was 556, and our minimum for this product is 580.

reply_bad.txt:

Hello Sola, we could not approve your N3,900 salary advance. Your score of 556 was below our 580 minimum, and your missed payment in March also counted against you. You can reapply with 15k less.
python3 check_reply.py reply_good.txt
python3 check_reply.py reply_bad.txt
money '₦39,000'    ->   3900000 kobo  ok
PASS

money 'N3,900'     ->    390000 kobo  NOT IN THE FACTS
money '15k'        ->   1500000 kobo  NOT IN THE FACTS
claim to check: the reply mentions 'missed'
CHECK 2 problem(s)

The second reply changes ₦39,000 into N3,900 (a factor of ten, so 390,000 kobo, not 3,900,000), invents a missed payment that no fact supports, and adds a “15k” figure out of nowhere. The checker catches the amounts and flags the claim, but it cannot judge tone or whether advice is appropriate. A person reads every message.

6. Check your own assistant’s reply. Run check_reply.py reply.txt on the reply you saved. Count how many problems it finds, then change decline_prompt.py to call the customer by another Nigerian name of your choice and see whether the assistant keeps it spelt as given.

Change the customer’s name in decline_prompt.py to a long Yoruba, Igbo or Hausa name with a tone mark or an apostrophe, or write the amount as “₦39k” in the facts, and paste the prompt again. Watch for a re-spelt name, a dropped mark or an amount re-read as ₦39 or ₦3,900. The checker only watches the numbers, so you must read the name yourself. A model that only seems to work on the examples its builders thought of is how the failures you cannot see get into production.

ARTEFACT Write the model use-case proposal ~50 MIN
YOU PRODUCEA model use-case proposal to the credit committee

Template

# Model use-case proposal: <model>, for <product>
Written by <analyst>, <team>. Approved or declined by <credit committee chair>. Date: <date>.

## 1. Decision requested
<One sentence: what the committee is asked to approve.> Not asked: <what stays as it is>.

## 2. The decision the model would inform
<Which decision, for which applicants, who makes it today, and what the model would change.>

## 3. The scorecard it is compared against
- Incumbent: <the table or rule that decides today, in one line>
- Measured on <n> loans, <n> bad: incumbent <AUC>, benchmark <AUC>, difference <AUC>
- The model's claimed result, labelled as the vendor's claim: <claim and its source>
- Definition of bad and date outcomes were read: <definition, date>

## 4. Data used
<Each input, where it comes from, and the consent basis. Anything left out and why.>

## 5. What the model cannot explain
<How reasons for a decline would be produced, and what is only an approximation.>

## 6. What our test cannot see
<Applicants with no outcome, small counts, drift.>

## 7. Conditions for a trial
Owner: <name>. Length: <months>. Success measure, agreed before the trial: <measure>. Switch-off: <who, how>. Review date: <date>.

## 8. How this could be wrong
<One way, and what would show it.>
WORKED EXAMPLE

At a real lender the model owner or an analyst on the credit risk team writes this proposal, and the credit committee chair approves or declines it. Here Sola, a product analyst at Owoleaf (200 people), writes it for Oyindamola, who runs credit risk and would own the model. Dated 2026-11-21. Figures are from the lab and cover all four products; ranking for salary advances alone would need a rerun.

Decision requested. Approve a three-month silent trial of the vendor’s ML score on salary advances, with Owoleaf’s rule still deciding every application. Not asked: switching the score on for any decision.

The scorecard. The incumbent is the hand-made points table. On the 288 approved borrowers with a bureau score it ranks at AUC 0.736 against 0.751 for the bureau score alone, so the table is 0.015 behind. There are only 36 bad loans in 372 (default or written_off at 2026-10-28), so that gap is within the noise. The vendor says its score finds 20% more good borrowers; that is its claim, not our measurement. The vendor must beat the table on loans neither has seen.

Data. Bureau fields and wallet behaviour, each listed with its source and consent basis. If the definition of bad counts the 8 loans in arrears, the bureau score’s AUC falls to 0.732 and the table’s to 0.714.

Cannot explain. The score’s reasons are SHAP estimates, not the model. No decline rests on the score until reason codes are agreed.

Cannot see. The 100 applicants declined for a score below the cut-off have no outcome. In the trial, the vendor’s score will see them.

Trial. Owner Oyindamola; three months; success measure agreed before it starts; Oyindamola can switch it off.

Could be wrong. With 36 bad loans, the table may be worse or better than 0.736 suggests. A range from a larger sample would show it.

Now you

You work in credit risk at a buy now, pay later lender in Abuja. A vendor offers a machine-learning score for your BNPL product and says it ranks borrowers at AUC 0.80 on your approved loans. Treat 0.80 as the vendor’s claim, not a measurement.

Use the lab as the lender’s book, stating that its AUC lines cover all four products, not BNPL alone. Run scorecard.py and read its AUC lines for the 288 borrowers with a score. Use outcomes.py for the BNPL line: 85 loans, lowest score 563, 19 thin files, against a cut-off of 560. Rerun scorecard.py with arrears counted as bad and note what moves.

Write the proposal to the credit committee. State the measured difference between the vendor’s claim and the scorecard, and what that claim does not prove. The committee chair reads it, and decides whether to approve a trial of the score running silently beside your current rule.

Self-check

DECIDE

Owoleaf at 200 people has a salary-advance book of about 190 loans in this lab and far more in the real business. A vendor's ML score claims better ranking than the bureau score. Oyindamola must decide how to proceed. The vendor's evidence is a test on loans Owoleaf already approved. A declined customer is entitled to ask why, and the product team wants a decision this quarter.

READING
  1. DOC
    Nigeria Data Protection Act 2023

    The Act's text as a copy hosted by a data-protection information service. Read section 37 on automated decision-making and the rights around it, and compare it with the Gazette copy before you cite a subsection. Skip the parts on the commission's administration.

  2. DOC
    EU AI Act, Regulation (EU) 2024/1689

    The official text. Read Annex III point 5 on credit scoring and Article 6 on how a system counts as high-risk, and check the application dates against any amending act.

  3. DOC
    AI Act, Annex III: high-risk AI systems

    A readable copy of the annex that names creditworthiness assessment. Read point 5(b) and its carve-out for fraud detection; skip the other categories.

  4. DOC
    Federal Reserve SR 26-2: Revised Guidance on Model Risk Management

    A US supervisory letter that search results say replaces the older SR 11-7, the long-used template for model governance: development, validation and oversight. It is not Nigerian law, and this chapter has not read the full text. Read the parts on validation and governance; skip the US-specific scope.

  5. PAPER
    Stop Explaining Black Box Machine Learning Models for High Stakes Decisions and Use Interpretable Models Instead Cynthia Rudin, 2019

    The case that a readable model is often as accurate as a black box in high-stakes settings. Read it as one side of the argument, then ask whether it holds on your data. Read: Sections 1 to 3.

  6. PAPER
    A Unified Approach to Interpreting Model Predictions Scott Lundberg and Su-In Lee, 2017

    The paper behind SHAP, the usual way to estimate how much each feature moved one score. Read the introduction to see what the estimate means and what it does not; skip the proofs. Read: Sections 1 and 2.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Project: an amortisation engine and a loan ledger →