Skip to content
All apps

Credit map: who pays back?

About this app

A bank learns from 150 simulated past customers (age and net income) who pays back a loan. Three learning methods draw the boundary: a straight line misses the U shape in age (underfitting), a curve with age² fits, the nearest neighbour gives every customer an island — 0 % wrong in training, but clearly worse on 150 new customers (overfitting). Drag Max Müller's application across the map.

With explain mode: an AI tutor walks you through the app, points out what matters in the scene and answers your questions.

A boundary between two groups

A bank estimates the probability of default of a loan from past customers for whom it knows whether they paid back. With two features such as age and net income every customer becomes a point on a map. A learning method draws a boundary between the two groups. Because they overlap strongly, borderline cases remain on the wrong side. If the line is too simple, it misses the real shape (underfitting); if it is so fine that it places every training customer correctly, it also learns the noise (overfitting).

What the app shows

150 simulated customers between 18 and 80 years. The risk falls with income and is U-shaped in age: the young are less solvent, middle age goes well, in retirement the risk rises again a little. A logistic regression with age and income draws a straight line and is wrong for 26 percent of the customers. With age squared the boundary becomes a curve and only 14.7 percent are wrong. The nearest neighbour gives every customer an island and has 0 percent error in training. On 150 new customers from the same world, however, it is at 23.3 percent, the curve at 12.7.

Try it yourself

Switch between straight, curve and each one and watch the surface, the boundary and the circles. Turn on the future to see the new customers. Drag Max Müller's application across the map and read how high the model estimates his default risk and whether the bank grants the loan. The threshold sets the probability from which the bank says no.

Frequently asked questions

What is overfitting?
A model overfits when it explains the training data almost perfectly, including their random outliers, and therefore does worse on new data. It shows as a large gap between a small training error and a clearly larger test error.
What is underfitting?
A model underfits when its form is too simple for the relationship, for example a straight line for a risk that first falls and then rises again with age. Then training and test error are both high. More data helps little here, a more flexible form does.
Why is the error measured on test data?
The error on the training data says little about how well a model does on new cases, because it already knows these data. Test data from the same distribution that were not used for learning estimate the error in use.
What can I try in the app?
Switch between three learning methods, show 150 new customers, drag Max Müller's application freely across the map, change the bank's threshold and use the magnifier to have every customer, the boundary and the surface explained. All customers are simulated.

Subject: Machine Learning

More from Machine Learning

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps