Skip to content
Learning

Reduce customer churn in a bank using machine learning

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.

10,000Source records
12Final input features
2,000Test observations
0.848Test ROC AUC

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.

Customer retentionBanking analyticsCampaign operations
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.

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.

SubsetRecords
Training6000
Validation / selection2000
Testing2000
Unused0
VariableRoleTypeEncodingUnit
credit_scoreInputNumericAs supplied
countryInputCategoricalFrance; Germany; SpainAs supplied
genderInputBinaryFemale; MaleAs supplied
ageInputNumericAs supplied
tenureInputNumericAs supplied
balanceInputNumericAs supplied
products_numberInputNumericAs supplied
credit_cardInputBinary0; 1As supplied
active_memberInputBinary0; 1As supplied
estimated_salaryInputNumericAs supplied
churnTargetBinary0; 1As supplied

Interactive chart: churn pie chart. Enable JavaScript to explore it.

churn pie chart. Exported with Neural Designer from the saved task report.

Interactive chart: churn Pearson correlations chart. Enable JavaScript to explore it.

churn Pearson correlations chart. Exported with Neural Designer from the saved task report.
This is internal validation using the saved record-level split. Grouped or temporal independence has not been established.

3. Model

The final model has 12 encoded input features and 1 outputs. The following dimensions describe the final saved network.

LayerInput shapeOutput shapeActivation
Scaling1212—
Dense124Tanh
Dense41Sigmoid

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.

Prioritizing bank customer retention: initial Neural Designer architecture
Initial architecture before selection. Diagram labels show original variables; categorical expansion and the numeric layer dimensions are documented in the model table.

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 error history. Exported with Neural Designer from the saved task report.

Quasi-Newton method results

MeasureValue
Epochs number147
Elapsed time00:00:00
Stopping criterionMinimum loss decrease
Training error0.486
Validation error0.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 training/selection errors plot. Exported with Neural Designer from the saved task report.

Growing neurons results

MeasureValue
Optimal neurons number4
Optimum training error0.4279
Optimum selection error0.4293
Epochs number10
Stopping criterionMaximum neurons reached
Elapsed time00:00:14
Prioritizing bank customer retention: selected Neural Designer architecture
Final architecture used for testing. Diagram labels show original variables; categorical expansion and the numeric layer dimensions are documented in the model table.

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 / predicted01Total
012283261554
1119327446
ClassTest casesSensitivity / recallSpecificityPrecision / PPVF1
0155479.0%73.3%91.2%0.847
144673.3%79.0%50.1%0.595

Interactive chart: ROC chart. Enable JavaScript to explore it.

ROC chart. Exported with Neural Designer from the saved task report.

Interactive chart: Cumulative gain chart. Enable JavaScript to explore it.

Cumulative gain chart. Exported with Neural Designer from the saved task report. This native curve is expressed in positive/negative rates. It is a discrimination view, not a validated fraction-of-customers campaign gain.

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.

References