Converter tool

Credit Scorecard Builder

Bin characteristics by weight of evidence, fit a logistic regression, scale it to points, and read KS, Gini, score bands, PSI and cut-offs. The scorecard exports as XLSX with formulas, as SQL and as CSV.

One row per account, with a good/bad outcome

1. Your data

Or paste the table
UCI Statlog data, CC BY 4.0, from one German bank in 1994.

Credit Scorecard Builder

Operator: Abdulla Al Fahad. How tools are built and checked

A scorecard is a table that gives every applicant a few points for each answer and adds them up. What makes it a scorecard rather than a black box is that each bin of each characteristic has a number you can read: the applicant with no checking account gets 74 points on that line, the one with an account in the red gets 28.

The work is in choosing the bins, so that default rates rise steadily from one bin to the next, and in scaling the model's log-odds into points so that a fixed number of points always doubles the odds of a good outcome. The page does both from a labelled table.

It then validates the card, with KS, Gini, score bands, cut-off trade-offs and stability between samples, and writes it out as a workbook, SQL and CSV.

Key features

  • Optimal binning for numeric and categorical characteristics by dynamic programming over up to 20 fine classes, with a size floor, a bin limit and a monotonic WoE pattern in the best direction
  • Missing values and user-listed special values (such as -999) as their own bins, and rare categories grouped together
  • Weight of evidence and information value, WoE correlation screening, VIF, and a logistic regression on the WoE values with automatic or hand selection
  • Points from a base score, base odds and points to double the odds (PDO), with KS, Gini, AUC, deciles, cut-off tables, PSI and CSI against a holdout or a second file
  • A group approval table for any column, including ones kept out of the model, with the ratio to the best-treated group

How a scorecard turns bins into points

The table needs one row per account, an outcome column and characteristic columns. You choose which outcome value means bad; everything else with a recorded outcome counts as good, and rows with an empty outcome are skipped. A column is read as numeric when at least 95% of its values parse as numbers and it has more than eight distinct values, otherwise as categorical, and you can override either way.

Empty cells, NA, NaN, null, ? and a bare dash count as missing. A special value is a number you list for a column; it gets its own bin instead of being binned with real values. The page builds scorecards on up to 100,000 rows, 60 characteristics and 500 distinct categories per characteristic.

Names that suggest age, sex, gender, marital or personal status, nationality, foreign status, postcode and similar are unticked by default and flagged. They are not removed from the page: tick one only if your lender is allowed to score on it.

A second sample needs the same column names; with an outcome column it is validated like a holdout, without one it feeds PSI and CSI only.

How it works

For each characteristic the values are cut into at most 20 fine classes (every distinct value when there are fewer). A dynamic program then finds the grouping of adjacent classes with the highest information value subject to the minimum bin size, the bin limit and, for numeric columns, a WoE that only rises or only falls with the value. Categories are first sorted by bad rate so adjacent merging keeps the order. WoE is ln(share of goods / share of bads) and IV sums (share of goods - share of bads) x WoE; a bin with no goods or no bads has 0.5 added to both counts.

Screening keeps characteristics with an IV above your minimum, drops the lower-IV member of any pair whose WoE correlation exceeds your limit, fits a logistic regression of bad on the WoE values by iteratively reweighted least squares, and removes any characteristic whose coefficient has the wrong sign, one at a time, optionally also any with a p-value above 0.05.

Scaling uses Factor = PDO / ln 2 and Offset = base score - Factor x ln(base odds). Each bin gets -(coefficient x WoE + intercept / m) x Factor + Offset / m points, rounded to a whole number, where m is the number of characteristics; the score is the sum of the integer points.

Typical uses

  • Holding out 30% of the German Credit rows (seed 12345) gives KS 0.521 on the 704 development rows and 0.470 on the 296 held out, an AUC of 0.781 there, and a score PSI of 0.133: some shift, which with 296 rows is mostly sampling noise.
  • Ticking the three protected-looking columns lifts the in-sample KS only from 0.490 to 0.517 while bringing in age, personal status and sex, a trade a fair-lending reviewer would have to accept explicitly.
  • Grouping the model without personal status by that column at the 521 cut-off gives approval rates of 52.2%, 48.1%, 51.1% and 40.0% for the four codes, so the group with 50 cases has a ratio of 0.77 to the best-treated one and is flagged under 0.80.

Building one

  1. Drop the labelled accounts, or load German Credit, and confirm the outcome column and which value is bad.
  2. Tick the characteristics, set their types and any special values.
  3. Set the bins, minimum bin size, monotonic or free WoE, holdout, screening limits and the scale.
  4. Press Build the scorecard, then read the points table, the characteristics, the validation and the group check.
  5. Download the scorecard CSV, the scoring SQL or the workbook.

Example

German Credit (1,000 loans, 300 bad) with age, personal status and sex, and foreign worker unticked; base score 600 at 50:1 odds, 20 points to double the odds

Load German Credit (1,000 loans)
Outcome: class, bad = 2
Bins: 6 at most, 5% minimum, monotonic

The checking-account characteristic and the card's validation

status_checking: A14 74 points (WoE 1.176), A13 56, A12 37, A11 28 (WoE -0.818); IV 0.666
Card of 11 characteristics: KS 0.490 at score 503, AUC 0.816, Gini 0.633
Factor 28.854, offset 487.123
Cut-off 521: approve 50.2%, bad rate among approved 10.0%, 83.3% of bads rejected

Things to check before you rely on it

An IV above 0.5 is more often leakage (a field set after the outcome) than insight; the example's checking-account status is 0.666, which is why it is worth asking what it measures.

KS and Gini on the development rows flatter the model. Use a holdout or a later sample; the page warns when KS falls by more than 0.10 outside development.

Bin edges are midpoints between observed values and special values are matched exactly, so a code stored as text with spaces will not match a listed number.

Cases whose category was never seen in development take the lowest-WoE bin of that characteristic, which is the cautious choice but not a model of unseen risk.

  • Raise the minimum bin size before adding bins: bins under about 5% of cases give WoE values that move when a handful of accounts change.
  • Lower the minimum IV only to look, never to include everything; characteristics under 0.02 add parameters without separating anyone.

Common errors and how to fix them

"Each outcome needs at least 30 cases"
The page builds a card only with at least 30 goods and 30 bads, because bins and coefficients below that are noise. Check which value is marked bad.
"No characteristic passed screening"
Lower the minimum IV, raise the correlation limit, or switch the characteristics setting to Exactly as ticked to build with a hand-picked set.
"no grouping meets the minimum bin size"
Lower the smallest bin percentage, allow more bins, or list sparse codes as special values.
"The WoE columns are collinear"
Two selected characteristics carry the same information. Untick one, or let automatic screening drop the weaker.
"The second sample has no column named ..."
The second file must use the same column headings as the development table for every characteristic in the card.

Best practices

  • Keep the outcome definition fixed (for example 90 days past due within 12 months) and write it next to the card.
  • Use a sample from a later period as the second file; a random holdout cannot show drift.
  • Look at the bins, not just the totals: every bin should be explainable to the person who has to defend it.

What the points mean

With a base score of 600 at odds of 50 to 1 and 20 points to double the odds, an applicant scoring 620 has odds of 100 to 1 good to bad, and one at 580 has 25 to 1. The factor 20 / ln 2 = 28.854 converts log-odds to points, and the offset 487.123 puts 50:1 at 600. Because each bin is rounded to a whole number, the card's score can differ from the unrounded model score by up to half a point per characteristic.

In the workbook the Scorecard sheet holds the good and bad counts per bin and calculates WoE, IV and points from them with formulas that read the intercept, factor and offset from the Settings sheet.

What this page cannot do for a lender

A scorecard used to approve or price credit needs independent model validation, ongoing monitoring, adverse-action reasons, and a fair-lending review that includes disparate treatment and less discriminatory alternatives. The group table here shows approval rates, not whether a proxy exists you did not think of.

There is no reject inference: accounts that were declined have no outcome and are not in the table, so the card describes the people who were approved. The German Credit sample comes from one bank in 1994 and includes attributes that current rules in many places bar from scoring; it is there to practise on.

Frequently asked questions

How was the 0.666 information value checked?

By hand, with one bin per checking-account code: goods 139, 164, 49 and 348 and bads 135, 105, 14 and 46 across A11, A12, A13 and A14, which sum to 700 and 300, give an IV of 0.666012. The page's binned figure is the same, because the four codes already have monotone WoE and none is under 5% of cases.

Why is the coefficient negative?

The model predicts the chance of bad, and WoE rises with safety, so a higher WoE lowers the chance of bad. A positive coefficient means the characteristic works against the others and is removed automatically in automatic mode, or flagged in manual mode.

Does the SQL handle missing values?

Yes. Each characteristic is a CASE expression: NULL maps to the missing bin's points (or the lowest points if there was no missing bin), listed special values and ranges follow, and an unseen category takes the lowest points.