PPGAPPGA
Interativo
PT 01 / 12
Doctoral thesis · PPGA Mackenzie · 2026

Can we tell in advance whose credit rating will be cut?

The research compared six machine learning models using data on thousands of companies rated by S&P. Those made of many decision trees anticipated, almost without error, who would be downgraded or default, and an explanation method showed what mattered in each risk band. Explained in 12 screens.

Author: Nazário Augusto de Oliveira Advisor: Prof. Dr. Leonardo Fernando Cruz Basso Program: Graduate Program in Business Administration (PPGA) · Mackenzie Presbyterian University
Company Warning before the downgrade Illustration, not data
Closest UN Sustainable Development Goals
scroll
02 What a rating is

A credit rating is a committee's opinion

Agencies such as S&P give companies a grade, the rating, that says how likely they are to pay their debts. The scale has 23 rungs, from AAA (the safest) to D (default). When the rating falls, debt becomes more expensive and contract clauses can be triggered.

Touch a rung. Each article in the thesis grouped the rungs in its own way.

A default is a factThe company stops paying interest or principal, files for bankruptcy or restructures its debt. It either happened or it did not.
A rating is a judgmentAnalysts combine numbers (debt, cash, profit) with assessments of management, governance and industry, and a committee decides. A model that learns from ratings also learns how the agencies decide.
safestdefault

Tables 2.5 and 3.2 and section 3.2.3 of the thesis. Table 3.2 places rung CC in band B; we kept it as it is.

03 The contenders

Six ways to pick out the companies that will fall

They all receive the same figures for each company and learn, from past examples, to draw a border between those that fell and those that did not. What changes is the shape of the border they can draw.

Our illustration with 60 made-up companies and only two figures per company. The thesis models use dozens of variables at once.

was downgradedkept its ratingthe model's warning zone
04 Article 1 · 20 countries

Almost 28,000 ratings, six in ten from the United States

The first article gathered, from the S&P Capital IQ Pro database, 3,453 rated companies from 20 countries, from 2018 to 2024, and 51 variables for each: 43 financial figures (debt, cash, margins, coverage) and 8 business assessments (industry risk, country risk, governance).

Because the mix of ratings varies a lot from country to country, the author trained one model per country. Touch a country.

27,664ratings (company and year)
59%come from the United States
5redundant variables dropped (e.g. EBITDA)
05 Article 1 · getting the rating right

With more companies, the models pull apart

Each model tried to get right the class (A, B, C or D) of companies it had not seen. In most countries, almost all topped 90%. In the United States, with more companies and a broader mix, the neural network and the trees pulled away from the traditional models. Touch a country.

Average accuracy over 5 repetitions of 10-fold cross-validation (Table 2.6). A single decision tree did worse; the thesis does not publish its figures.

neural networktreestraditionalplate: always guessing the most common class
06 Article 2 · a new question

Now the question changes: will this company fall in the next 12 months?

The second article used 31,151 company observations (2017 to 2022) and 46 variables. Instead of guessing the rating, each model answers yes or no: will the company be downgraded or default in the following year? And there is one model for each of the six risk bands.

To mimic real use, the models learned from 2017 to 2021 and were tested on 2022, a year they had never seen.

2017–2021 · learn
2022
about 25,000 observations6,151 for testing

Height = share of downgrade or default cases in each band (Table 3.1).

07 Try it

Catching who falls without crying wolf

When few companies fall, “being right a lot” is misleading: whoever says nobody will fall is almost always right and is of no use. That is why the thesis measures two things at once: of those that fell, how many the alarm caught and of the alarms, how many were real. The F1 combines both into a score from 0 to 1.

Adjust how sensitive the alarm is.

A real case from the thesis. In the highest-risk band, only 0.64% of the cases are falls. There, logistic regression got 98.9% of the companies right, but its F1 was 0.52: it caught almost every fall at the cost of many false alarms (Tables 3.4 and 3.10).
loose alarmstrict alarm
Of those that fell, the alarm caught0
Of the alarms, were real0
F1 (combines both)0

Illustration with 100 made-up companies, 20 of them heading for a downgrade. The thesis also uses the AUC (from 0.5, a coin toss, to 1, perfect separation) and the MCC (from −1 to 1).

08 Article 2 · the result

XGBoost and Random Forest made almost no mistakes in any band

The two tree models came close to the maximum (1) in all six bands; XGBoost reached 1.000 at both ends of the scale. Logistic regression and SVM did reasonably in the good bands and stumbled in band BB and in the riskiest ones.

Table 3.4 (5-fold cross-validation) and Table 3.7 (learns from 2017–2021, tests on 2022). Height proportional to the value, starting from zero.

09 Article 2 · a new year

Faced with 2022, SVM lost the most

A model can do well on the data it learned from and fail the following year. Compare, band by band, the cross-validation result (●) with the 2022 test result (◆). XGBoost barely moved; SVM plunged in bands BB and CCC.

10 Article 2 · opening the black box

Management and governance weigh most in every band; liquidity gains weight with risk

To explain the predictions, the thesis used SHAP, a method that measures how much each variable pushed the model's answer. On average, the assessment of management and governance came first in all six bands. Right below it, in the safer bands comes the industry; from band BB down, liquidity, the cash at hand to pay the bills.

Approximate values, read from the charts in Figure 3.3 (mean absolute SHAP value, the seven most influential variables in each band).

11 The unexpected · Appendix D

Without the previous rating, accuracy drops, above all in the riskiest band

Results so close to perfection raise suspicion. The author redid the analysis in two ways: without the size variables (revenue, debt in absolute values) and without the rating history (the previous rating and the agency's last rating action).

Without size, nothing changed. Without the history, the F1 fell, slightly for XGBoost and sharply for Random Forest. In the riskiest band, Random Forest went from 0.93 to 0.25. Touch a band.

without the size variableswithout the rating history
12 In practice, limits and credits

An alarm that explains why it went off

Banks and investors

XGBoost suits cases where missing a company that will fall is costly; Random Forest, when computing cost matters. Logistic regression stays as a benchmark for low-risk portfolios.

Risk monitoring

What signals danger changes with the band: in the risky bands, watch liquidity and charge coverage; in the safe ones, the industry and scale.

Regulators

Rules such as those of the European Banking Authority and the Fed require models to be explained and validated. SHAP shows what weighed in each prediction.

Researchers

Suggested next steps: news, reports and market data (CDS), real-time analysis and models that are explainable by design.

What this research does not say

  • One source, one test year. Data from a single database (S&P) and a test on 2022 only; other economic cycles may change the picture. · according to the author
  • Structured figures only. News, analyst reports and market signals were left out. · according to the author
  • Explanation after the fact. SHAP explains the finished model; the author suggests models that are explainable by design. · according to the author
  • Almost perfect, helped by history. Part of the accuracy comes from knowing the previous rating (Appendix D), information that does not appear in the list of variables in Table 3.3. · our note
  • No comparison with a single model. The thesis argues for one model per band, but does not show the result of one model for all bands together. · our note

Credits

How to cite
OLIVEIRA, Nazário Augusto de. Explaining corporate credit rating transitions and defaults through machine learning: a data-driven approach to risk assessment. Doctoral thesis (Business Administration) — Mackenzie Presbyterian University, São Paulo, 2026. Advisor: Prof. Dr. Leonardo Fernando Cruz Basso.

A thesis in two articles, the first published in the journal Risks. Full tuition waiver from Instituto Presbiteriano Mackenzie. The author declares having used ChatGPT for text revision, organizing the work and programming support. This version simplifies the thesis for a general audience.