Neural Networks in Lending
Lending is prediction. A lender who receives a mortgage application has to judge, from what the application shows, whether the borrower will repay, and more and more of that judgment is made by software. This chapter uses public data on mortgage applications to show what a neural network adds to the models lenders have long used, and then turns to two questions that matter more in lending than in reading digits: whether a decision can be explained to the applicant, and whether it treats groups of applicants fairly.
How lenders decide
Three numbers dominate a mortgage application. The debt-to-income ratio (DTI) is the borrower’s monthly debt payments, including the new mortgage, as a percentage of monthly income: it measures the ability to pay. The loan-to-value ratio (LTV), or the combined ratio (CLTV) when there are several loans on the home, is the debt secured by the home as a percentage of its value: it measures how much the lender loses if the borrower stops paying and the home is sold. The credit score summarizes the borrower’s history of repaying other debts.
Lenders who sell their loans to Fannie Mae or Freddie Mac must follow their underwriting rules, and these rules have sharp limits. For loans evaluated by Fannie Mae’s automated system, Desktop Underwriter, the maximum debt-to-income ratio is 50%; for loans underwritten manually it is 36%, and up to 45% for borrowers with strong credit scores and reserves (Fannie Mae 2025). A borrower at 49% and one at 51% are nearly the same risk, but they face different rules. To sell a loan to Fannie Mae or Freddie Mac, the lender submits the application’s data, including the credit score, income, reserves, debt-to-income ratio and loan-to-value ratio, to their automated underwriting systems, Desktop Underwriter and Loan Prospector, which recommend approval or not (Bartlett et al. 2022).
Technology has also changed who lends. Buchak et al. (2018) show that the share of mortgages originated by shadow banks, lenders that take no deposits, nearly doubled, from roughly 30% in 2007 to 50% in 2015, and that online FinTech lenders were an important part of that growth. Fuster et al. (2019) define FinTech lenders as those whose application process “can be completed entirely online,” and find that their market share rose from 2% to 8% between 2010 and 2016 and that they process applications 20% faster than other lenders, without higher defaults.
The data
The Home Mortgage Disclosure Act of 1975 requires most mortgage lenders to report every application they receive and what they did with it. Monitoring fair lending was one of its main purposes, and HMDA data have been the main source for studying unequal access to mortgage credit (Fuster et al. 2022). Since 2018, the public files also report the loan-to-value ratio and the interest rate of each loan (Bartlett et al. 2022), as well as the debt-to-income ratio. They do not report the credit score.
The notebook Predicting Mortgage Denials uses applications to buy a home in Missouri in 2023 that were either originated or denied, for conventional first-lien loans on single-family homes the buyer will live in. Figure 1 shows the share denied by debt-to-income ratio.
Up to a ratio of 49%, between 2.5% and 5% of applications are denied, with little trend. From 50% to 60%, 36% are, and above 60%, 83%. The data show the underwriting limit as a cliff.
Predicting a yes or no
A denial is a yes-or-no outcome, a classification with two classes. With two classes, the softmax of the chapter From Regression to Neural Networks reduces to the logistic function: the model computes one score s, and the probability of a denial is p = \frac{1}{1 + e^{-s}}. \tag{1} The probability is one half when s = 0, approaches one as s grows and zero as it falls. If the score is linear in the inputs, s = w_0 + \mathbf{w}'\mathbf{x}, this is the logit, the standard model of default and denial in banking and in research. A neural network computes the score with a hidden layer instead. Either model is trained by minimizing the cross-entropy, which for an outcome y_i equal to one (denied) or zero (approved) is L = -\frac{1}{n} \sum_{i=1}^{n} \Bigl[ y_i \ln p_i + (1 - y_i) \ln (1 - p_i) \Bigr]. \tag{2}
The logit’s limitation shows in Figure 1. Its probability is the same S-shaped function of a linear score, so along any one input it can only rise gradually or fall gradually. To approach the high denial rates above 50%, it would have to start rising long before, where the data show no trend. Fitting the whole sample, it compromises: it overstates denials between about 40% and 50% and understates them above 55%. The network places kinks where the data bend and follows the cliff, without being told where it is.
Measuring a rare outcome
In this sample only 5.2% of applications are denied. A model that predicts “approved” for every application is right 94.8% of the time and useless, so accuracy, the share of correct answers, says little when one outcome is rare. A better measure compares the predicted probabilities p_i with the outcomes, against the simplest forecast, the denial rate \bar{y} of the training sample, as an R^2: R^2 = 1 - \frac{\sum_i (y_i - p_i)^2}{\sum_i (y_i - \bar{y})^2}, \tag{3} computed on test applications that the models were not trained on. The numerator is known as the Brier score of the forecasts. Research on default prediction, including Fuster et al. (2022), also reports the area under the ROC curve (AUC), the probability that the model gives a randomly chosen defaulter a higher score than a randomly chosen non-defaulter.
On the Missouri test applications, the logit has an R^2 of 0.115 and the network 0.217: the network explains about twice as much. Its R^2 on the training applications is almost the same, 0.216, so it is not overfitting. Even so, the network explains only about a fifth of the variation in denials, because the public data omit most of what the lender sees, starting with the credit score.
Bins chosen by people or by data
A logit can produce a cliff too, if someone adds the right inputs: dummy variables for debt-to-income ratios above 50%, for example. Lenders have long done this. Fuster et al. (2022) estimate a “Nonlinear Logit” that cuts the loan-to-value ratio, the credit score and income into bins, “reflecting standard industry practice,” and compare it with machine learning models built from trees, which also cut the inputs into bins, except that “rather than the lender prespecifying the bin-ends, the process is fully data-driven.” A network does the same with kinks. In the notebook, a logit with dummies at the underwriting limits matches the network on the Missouri data, but only because Fannie Mae publishes its limits. In most problems nobody knows where the cutoffs, interactions and curves are, and finding them from data is what flexibility buys.
Explaining a decision
A lender that denies an application must tell the applicant why. Under the Equal Credit Opportunity Act and its implementing Regulation B, the notice of an adverse action must come within 30 days of a completed application, and its statement of reasons “must be specific and indicate the principal reason(s) for the adverse action.” A statement that the applicant “failed to achieve a qualifying score on the creditor’s credit scoring system” is insufficient (Consumer Financial Protection Bureau, n.d.). These are the reasons HMDA reports for each denial.
For a logit, the reasons are easy to find: the score is a sum of weights times inputs, and the inputs that lowered it most are the principal reasons. For a network, each input’s effect depends on all the others, through every hidden unit, and there is no single weight to read. Methods exist to attribute a network’s prediction to its inputs, but they are approximations, and a lender has to stand behind the reasons it gives. In 2022 the Consumer Financial Protection Bureau stated that creditors who use complex algorithms, including machine learning, must still give specific and accurate reasons, and that the law does not allow technology that prevents them from doing so (Consumer Financial Protection Bureau 2022). The Bureau withdrew that circular in May 2025, along with dozens of other guidance documents (Consumer Financial Protection Bureau 2025); Regulation B’s requirement of specific reasons did not change.
Fairness
The Equal Credit Opportunity Act forbids lenders to discriminate on the basis of race, color, religion, national origin, sex, marital status or age, among other characteristics. Fair-lending law also prohibits “credit determinations that disparately affect minority borrowers if those determinations are based on characteristics unrelated to creditworthiness” (Bartlett et al. 2022). Leaving race out of a model does not settle the question. Income, loan size, the loan-to-value ratio and many other inputs differ on average across groups, and a flexible model can combine them in ways that track a characteristic it never sees.
Fuster et al. (2022) study what happens when lenders switch from a logit to machine learning to predict default. With administrative data on close to 10 million mortgages originated from 2009 to 2013, they find that “Black and Hispanic borrowers are disproportionately less likely to gain from the introduction of machine learning,” and, in a model of the credit market, that machine learning “increases disparity in rates between and within groups, with these changes attributable primarily to greater flexibility.” The better prediction is real, and so is its uneven distribution.
Bartlett et al. (2022) compare interest rates on loans guaranteed by Fannie Mae, Freddie Mac and the FHA, for which the guarantor bears the credit risk, so that rate differences among borrowers of the same risk cannot be justified by creditworthiness. For loans issued from 2009 to 2015, they find that Latinx and Black borrowers paid 4.7 to 4.9 basis points more on purchase mortgages, costing them over $450 million a year, and that the disparities at FinTech lenders were similar to those of other lenders for loans sold to Fannie Mae and Freddie Mac. Algorithms do not remove discrimination on their own, and they do not necessarily add to it. Whether algorithmic decisions promote or inhibit discrimination, in their words, “is fundamentally an empirical one,” and HMDA is where it is studied.
Practice Problems
These problems give you a chance to practice the concepts introduced in this chapter. Try to solve each one on your own before expanding the solution.
Problem 1 (A Model That Is Right 95% of the Time) A lender’s data science team reports that its new model of mortgage denials is correct for 95% of applications. In the lender’s data, 5% of applications are denied. Which statement is most accurate?
- The model is excellent, because 95% is a high accuracy.
- The accuracy alone says nothing about the model’s value, because a rule that approves every application is also correct 95% of the time; the team should compare predicted probabilities with outcomes against a benchmark, for example with the R^2 of 3.
- The model must be overfitting, because no model can be correct 95% of the time.
- The model is useless, because it cannot be more accurate than the denial rate.
Solution
The answer is (b). With a denial rate of 5%, approving everyone is correct for the 95% of applications that are approved, so 95% accuracy is what a model with no information achieves. A useful model has to do better than that benchmark, and measures that use the predicted probabilities, such as the R^2 against the base rate or the area under the ROC curve, show whether it does. Nothing in the number shows overfitting, so (c) is wrong, and (d) confuses accuracy with the denial rate.Problem 2 (From a Score to a Probability) A logit for mortgage denials has the score s = -9 + 0.12 \times \text{DTI}, with the debt-to-income ratio in percent. Use 1 to compute the probability of denial at a debt-to-income ratio of 40%, 50% and 60%. Then compare the change from 40% to 50% with the change from 50% to 60%. Could this model reproduce a jump in the denial rate from 5% to 36% between 49% and 50%?
Solution
At 40%, s = -9 + 4.8 = -4.2 and p = 1/(1 + e^{4.2}) = 0.015. At 50%, s = -3 and p = 1/(1 + e^{3}) = 0.047. At 60%, s = -1.8 and p = 1/(1 + e^{1.8}) = 0.142. The probability rises by 3.3 percentage points from 40% to 50% and by 9.5 from 50% to 60%: the logistic curve steepens gradually. A jump of 31 points between 49% and 50% would need a slope so large that the probability would already be rising steeply well below 49%, where the data show no trend. A linear score cannot do it; a dummy for ratios of 50% or more, or a network that places a kink there, can.Problem 3 (Reasons for a Denial) A lender denies a mortgage application on the recommendation of a neural network and sends the applicant a notice that says: “Your application did not achieve a qualifying score on our proprietary credit model.” Select all statements that apply.
- The notice satisfies Regulation B, because it names the model the lender used.
- The notice does not satisfy Regulation B, which requires specific principal reasons and says that failing to achieve a qualifying score is insufficient.
- A lender that uses a network must still be able to say which factors, such as a high debt-to-income ratio, were the principal reasons for the denial.
- Since the CFPB withdrew its 2022 circular on complex algorithms, lenders that use machine learning no longer have to give reasons.