liveBook · Manning

Logit

As explained in Financial AI in Practice

The logarithm of the ratio of an event’s probability to the probability of its complement.

A logit is the logarithm of an event’s probability divided by the probability of its complement: log(p / (1 − p)). In credit scoring, log-odds support weight-of-evidence feature encoding and conversion of default probabilities into scores. section 5.3.4 section 5.3.7

In credit-score conversion:

  • Compute default odds as p / (1 − p), then transform their logarithm into a score using a scale factor and offset. section 5.3.7
  • A points-to-double-odds scale can make each 20-point increase correspond to roughly doubled odds of being a good borrower. section 5.3.7
Listing 5.17 BFSI score conversion and distribution
import math
import numpy as np
import matplotlib.pyplot as plt

base_score = 650
PDO = 20                              #1
factor = PDO / np.log(2)     #2
offset = base_score - (factor * np.log(20))     #3

def calculate_score(prob_default, factor, offset):    #4
    prob_default = np.clip(prob_default, 1e-6, 1 - 1e-6)
    odds = prob_default / (1 - prob_default)
    raw_score = offset - factor * np.log(odds)
    return np.clip(raw_score, 250, 1000)     #5

scores = calculate_score(predictions, factor, offset)
scores = np.round(scores)     #6

plt.figure(figsize=(8, 5))
plt.hist(scores, bins=20, edgecolor='black')     #7
plt.title('Credit Score Distribution')
plt.xlabel('Score')
plt.ylabel('Frequency')
plt.show()

Python example calculating and plotting credit scores from model probabilities, with probability and score clipping. section 5.3.7

How Financial AI in Practice covers it

How deep it goes
Defines odds and demonstrates probability-to-score formulas with clipping and score-distribution visualization.
Examples
Uses WoE-coded features and a PDO example anchored at score 650, with 20 points doubling good-borrower odds.
What you can do after
Apply it via NumPy to convert predicted default probabilities into clipped, rounded credit scores.
How it connects
Links log-odds to weight of evidence, default probability, and credit scoring.

Also explained in

Compare how 17 books explain logit →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Financial AI in Practice. The section links point to the parts of the book it draws on.