German Credit: whom should the bank lend to?
Example- Problem definition
- A credit officer decides whether to accept or reject each application. The project predicts the target variable, good or bad credit, from the application and the bank's records, extending case 23.2 from the book to the full final project.
- Data and partitioning
- Four protected attributes of the book's 1,000 past applicants are set aside under the Equal Credit Opportunity Act. Five fold cross validation on 800 records compares seven families, the neural network included, and 200 are held out.
- Model evaluation and selection
- Logistic regression deploys at a cutoff of 0.833, planned at 14,250 DM per 1,000 applicants from AI Studio's cross validation. On the holdout the Python fit earns 14,500 and AI Studio's deployed model 28,000.
This example comes from the book. Case 23.2, German Credit, from the course textbook (Shmueli, Bruce, Deokar and Patel, Machine Learning for Business Analytics, RapidMiner edition), is extended to everything the final project asks for. The case supplies the data, the setting and the cost table, and the project adds the full tournament, the deployment rule, the monitoring plan and the responsible ML assessment. Today a credit officer decides each application by judgment, from the application form. The target variable is RESPONSE, and the task is supervised classification. The book puts a price on each error. A loan to a good credit earns 100 DM, and a loan to a bad credit loses 500 DM. Before any model was scored, the charter fixed the cutoff from the cost table and priced a readable equation at 5,000 DM per 1,000 applicants.
The data file holds 1,000 past applicants with 30 attributes, 700 good and 300 bad, as the book distributes them. It has no missing values. The book asks about one finding. On the 800 modeling records, applicants with a critical credit history have the highest good credit rate (84 percent, against 36 percent with no credits taken), because the bank was already lending to those accounts selectively.
Full summary
Data cleaning and feature selection set aside the observation number and four attributes. Sex and marital status (the three MALE flags) and foreign worker status (FOREIGN) cannot be a basis for a credit decision under the Equal Credit Opportunity Act. They stay in the file for the fairness check. The codes are kept as the book keeps them, as ordered numbers. One-hot coding earns the same 15,750 DM per 1,000, so the ordered codes stay (report, section 2). The leakage audit checked four threats, which report section 2 names, and the observation number carries no signal about the outcome.
The data visualization charts good credit rates by checking account, credit history and age band, on the modeling records only.
The data partitioning splits the data into 800 records for modeling and 200 held out, stratified, seed 2026, before any fit. With 1,000 records a separate validation set would be too thin, so five fold cross validation on the 800 selects the model, with normalization fitted inside each fold. The holdout is used once, for the final evaluation.
For model training and tuning, a baseline and seven families run on the same folds. They are the naive baseline, logistic regression, k-NN, naive Bayes, a decision tree, a random forest, gradient boosted trees and the required neural network. Each setting was swept by cross validation in the Python run, where logistic regression keeps C = 0.01, k-NN keeps n_neighbors = 61 and the network keeps hidden_layer_sizes = (16,), alpha = 0.001, learning_rate_init = 0.01. AI Studio's learners differ from scikit-learn's, so all seven were swept again there, and each process holds the setting AI Studio kept in the learner inside its Cross Validation operator. The H2O logistic regression keeps an L2 penalty lambda of 0.03, the network trains 50 cycles at a learning rate of 0.001, and the forest, naive Bayes, k-NN, the decision tree and gradient boosted trees keep the settings in report Tables A5 to A9 (report, section 8).
For model evaluation and selection, the cost table puts the cutoff at 0.833 (500/600; entered as 0.8333 in the AI Studio Threshold operator) on the probability of good credit. The out of fold profit curve peaks at 0.75, 250 DM per 1,000 higher, and one loan changing sides on 800 records would close that gap, so the cost table's cutoff stays (report, section 4). The random forest led cross validation by 1,125 DM per 1,000 applicants. The charter had priced a readable equation at 5,000 DM, so logistic regression deploys. The planning figure is 14,250 DM per 1,000 applicants, from AI Studio's cross validation of the deployed specification (report, section 8). The holdout gives two checks. The Python fit of the same specification earns 14,500 DM per 1,000, and AI Studio's stored model, the one deployed, earns 28,000. Accepting everyone loses 80,000 DM per 1,000. The Python fit accepts 26.5 percent of the holdout applicants, and 4 of its 53 accepted loans (7.5 percent) are bad credits. On 200 records the stored model's holdout figure is a favourable draw, which is why the cross validated fits of the same specification give the planning number. The recommendation holds unless a bad loan costs less than about 1.6 or more than about 12 times what a good loan earns. Below that range lending to everyone pays more, and above it lending to no one does (report, section 4). In AI Studio's cross validation the neural network leads by 2,375 DM per 1,000, under the 5,000 DM rule, so logistic regression deploys in both tools.
For implementation and application, the one deployed model is the H2O logistic regression that process 06 stores in AI Studio and process 07 uses to score each new applicant. The recorded presentation runs process 07 on screen, where the stored model scores the applicant at 0.761 and the application is rejected. The Try it panel scores the same applicant with the Python equation, at 0.724, and both reject. An applicant whose probability of good credit is 0.833 or higher is accepted, and one below 0.833 is rejected by the model and routed to the credit officer's queue. The monitoring plan has five parts, which are the metric watched, the drift signal, the cutoff check, the retraining trigger and the owner. The bank accepts a random share of applications scored just below the cutoff. If those loans repay above break even after a year, the cutoff moves to 0.75. The responsible ML assessment checks acceptance by age, foreign worker status and sex, and it prices what the bank gives up by leaving the forbidden attributes out at 1,625 DM per 1,000 applicants in cross validation, about three bad loans' losses (500 DM each) per 1,000, with the model that includes them swept over the same values of C and kept the same way.
The seven processes were run in Altair AI Studio 2026.1.1 on 2026-10-15 and again on 2026-10-18, after every learner was swept in AI Studio. The engine's own results are in the report (section 8) and in results/rm_results.json in the zip, and its exported pictures of every process are in the workflow PDF. The method map is the first document to read. The course follows the eight step machine learning process from the Week 1 notes, and the map matches this project to it step by step and to the final package rubric.
Try it: Score an applicant
LiveThe Python fit of the same specification.
- Probability of good credit
- 0.724
- Decision at the cutoff of 0.833
- Reject, to the credit officer's queue
- Accept when the probability of good credit is 0.833 or higher. Below that, the model rejects the application and routes it to the credit officer's queue.
The rows behind it (6)
| Term | Log odds against the average | Odds multiplier against the average |
|---|---|---|
| Checking account = 0 to 200 DM | -0.21 | 0.81 |
| Credit history = Existing credits paid back so far | -0.13 | 0.88 |
| Duration, months = 24 (average 20.95) | -0.05 | 0.95 |
| Has other installment credit = no | +0.05 | 1.05 |
| Owns the residence = yes | +0.04 | 1.04 |
| Present employment since = 4 to 6 years | +0.03 | 1.03 |
Attributes not shown are held at the scored applicant's values (NEW_CAR 0, USED_CAR 0, FURNITURE 0, RADIO/TV 1, EDUCATION 0, RETRAINING 0, CO-APPLICANT 0, PRESENT_RESIDENT 2, REAL_ESTATE 0, PROP_UNKN_NONE 0, RENT 0, JOB 2, NUM_DEPENDENTS 1, TELEPHONE 1). The defaults reproduce the Python fit's score of the process 07 applicant, 0.724, a rejection. The deployed model, AI Studio's stored logistic regression, scores the same applicant at 0.761 in process 07 and also rejects. Each reason is the coefficient times the value minus its 800 record average.
Licensed CC BY-NC-ND 4.0: share with credit, no commercial use, no changes. The Project Shelf Team, Fall 2026.
Case 23.2, German Credit, from Shmueli, Bruce, Deokar and Patel, Machine Learning for Business Analytics (RapidMiner edition, Wiley, 2023), solved by the course instructor as a worked example.