Prioritizing bank customer retention
A retention team needs to identify customers who may leave before committing resources to a campaign. This example trains a classifier on customer profiles and evaluates its ability to rank recorded churn outcomes.
1. Business decision
Retention teams need to distinguish a churn score from the benefit of a retention offer. This example studies the former, using recorded customer and account characteristics.
Customer context
Compare account, tenure and demographic patterns.
Churn discrimination
Inspect missed churners as well as correctly classified customers.
Campaign evaluation
Measure the effect of an offer separately before assigning a campaign budget.
2. Data set
The supplied benchmark contains customer account records. It supports a retrospective classification exercise; the project does not establish a future observation horizon or the causal effect of a retention offer.
The downloadable project, saved report and supplied source CSV define the exact version used here. The project does not identify an independently verified external data record.
| Subset | Records |
|---|---|
| Training | 6000 |
| Validation / selection | 2000 |
| Testing | 2000 |
| Unused | 0 |
| Variable | Role | Type | Encoding | Unit |
|---|---|---|---|---|
| credit_score | Input | Numeric | As supplied | |
| country | Input | Categorical | France; Germany; Spain | As supplied |
| gender | Input | Binary | Female; Male | As supplied |
| age | Input | Numeric | As supplied | |
| tenure | Input | Numeric | As supplied | |
| balance | Input | Numeric | As supplied | |
| products_number | Input | Numeric | As supplied | |
| credit_card | Input | Binary | 0; 1 | As supplied |
| active_member | Input | Binary | 0; 1 | As supplied |
| estimated_salary | Input | Numeric | As supplied | |
| churn | Target | Binary | 0; 1 | As supplied |
Interactive chart: churn pie chart. Enable JavaScript to explore it.
Interactive chart: churn Pearson correlations chart. Enable JavaScript to explore it.
3. Model
The final model has 12 encoded input features and 1 outputs. The following dimensions describe the final saved network.
| Layer | Input shape | Output shape | Activation |
|---|---|---|---|
| Scaling | 12 | 12 | — |
| Dense | 12 | 4 | Tanh |
| Dense | 4 | 1 | Sigmoid |
Output semantics: the sigmoid score increases toward 1; 0 is the other class. Calibration has not been evaluated, so scores are not presented as calibrated probabilities.

4. Training strategy
The saved training configuration uses WeightedSquaredError with QuasiNewton. Training minimizes the recorded objective; the validation subset monitors generalization during fitting. The testing subset is used for the evaluation below.
Interactive chart: Quasi-Newton method error history. Enable JavaScript to explore it.
Quasi-Newton method results
| Measure | Value |
|---|---|
| Epochs number | 147 |
| Elapsed time | 00:00:00 |
| Stopping criterion | Minimum loss decrease |
| Training error | 0.486 |
| Validation error | 0.478 |
5. Model selection
The following search results are recorded in the saved report. Selection used the validation subset. These are the selected settings within the tested search; they do not establish a globally optimal model.
Interactive chart: Growing neurons training/selection errors plot. Enable JavaScript to explore it.
Growing neurons results
| Measure | Value |
|---|---|
| Optimal neurons number | 4 |
| Optimum training error | 0.4279 |
| Optimum selection error | 0.4293 |
| Epochs number | 10 |
| Stopping criterion | Maximum neurons reached |
| Elapsed time | 00:00:14 |

A transparent test-set comparator is the majority-class rule, with accuracy 77.7%. This is a baseline for interpretation, not an alternative model fitted on the test labels.
6. Testing analysis
The final classifier is evaluated on 2,000 testing records. The confusion counts below were reproduced from the saved model. Rows are actual classes and columns are predicted classes. The decision threshold is 0.5 on the score for 1.
Test class prevalence is shown by the support counts. Accuracy is 77.8% and macro F1 is 0.721. ROC AUC is 0.848. The native ROC optimal threshold is descriptive of this test set and is not an independently validated operating policy.
| Actual / predicted | 0 | 1 | Total |
|---|---|---|---|
| 0 | 1228 | 326 | 1554 |
| 1 | 119 | 327 | 446 |
| Class | Test cases | Sensitivity / recall | Specificity | Precision / PPV | F1 |
|---|---|---|---|---|---|
| 0 | 1554 | 79.0% | 73.3% | 91.2% | 0.847 |
| 1 | 446 | 73.3% | 79.0% | 50.1% | 0.595 |
Interactive chart: ROC chart. Enable JavaScript to explore it.
Interactive chart: Cumulative gain chart. Enable JavaScript to explore it.
7. Model deployment
Validated inputs → saved preprocessing → neural network → score or estimate → domain review. The ZIP contains the original project, source CSV, schema, test metrics and standalone interactive chart exports. The project hash in the schema identifies this exact version.
Explore the exported model
This research demonstration runs locally in your browser. Values outside the training range are outside the validated domain and are rejected. A valid input range does not guarantee that a combination is physically or operationally plausible.
This is a research demonstration, not a validated decision policy.
8. Evidence and limitations
A churn score does not establish which intervention will work. Evaluate on later customer cohorts, audit protected and proxy attributes, and measure incremental retention through a controlled campaign before claiming financial benefit.
No external validation or independent calibration study is included. Preprocessing statistics and model choices should be refitted within a prospective or grouped validation design. Correlations and directional responses describe associations, not causes. Human review is required before an operational decision.
Confidence intervals, subgroup performance, calibration curves and decision-cost validation are not established by these tasks. Predictive values apply to the observed test class distribution and may change when prevalence shifts.



