<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=2877026&amp;fmt=gif">

Prospective Customer Identification for Term Deposit using XG-Boost

By Clairvoyant Perspectives - November 26, 2021

A term deposit is a major source of income for a bank. A term deposit is an investment held at a period financial institution. The money is invested for an agreed rate of interest over a fixed time.

The bank has various outreach plans to sell term deposits to their customers such as email marketing, advertisements, telephonic marketing, and digital marketing but identification of prospective customers for products is a huge problem in the banking sector.

Marketing products to the customers requires huge investment as large marketing firms are hired to carry out the product/service marketing at scale. Hence it is crucial to identify the customers that are most likely to convert beforehand in order to specifically target them.

This would be beneficial both for the bank and the customers since it would result in reduced marketing cost, also only interested customers would receive the marketing communication.


Problem Outline

The bank must identify an approach to identify the most prospective customers for the term deposit so that they can be specifically targeted as blanket targeting would be ineffective and cost heavy.

Solution Approach

  1. Gather customer level data that has all available details on existing customers:

    1. Demographics Data

    2. Transactional Data

    3. Loan Details

    4. Communication and engagement details

    5. Banking Data

  2. Flag the customers that are already term deposit subscribers

  3. Using the above-mentioned data train an XG-Boost Model to predict whether a customer would subscribe to a term deposit or not

  4. Validate and tune the model to give out more accurate predictions

  5. Predict the term deposit flag for new customers

  6. Send the list of customers that are more likely to subscribe to the marketing agency

Solution Approach


We will be using the following dataset to illustrate how can this problem be solved:

Banking Dataset - Marketing Targets | Kaggle


Feature Description:

  1. age - age

  2. job : type of job

  3. marital : marital status

  4. education

  5. default: has credit in default? (binary: "yes","no")

  6. balance: average yearly balance, in euros (numeric)

  7. housing: has a housing loan? (binary: "yes","no")

  8. loan: has a personal loan? (binary: "yes","no")

  9. contact: contact communication type

  10. day: last contact day of the month

  11. month: last contact month of the year

  12. duration: last contact duration, in seconds

  13. campaign: number of contacts performed during this campaign and for this client

  14. pdays: number of days that passed by after the client was last contacted from a previous campaign

  15. previous: number of contacts performed before this campaign and for this client

  16. poutcome: outcome of the previous marketing campaign

  17. y - has the client subscribed to a term deposit? (Output variable| binary: "yes","no")


Let us first have a look at how the target variable is distributed:

Let us first have a look how is the target variable distributed

Let us also try to understand people of which age group are more likely to subscribe to a term deposit:

Let us also try to understand, people of which age group are more likely to subscribe to a term deposit

Model Fitting with Hyperparameter tuning:

Splitting the data into training and testing:


Defining the space across which the hyperparameters would be tuned:


Defining function to iteratively fit models across the hyperparameter space:


Printing out the best parameters:




Final Model Evaluation:

We finally fit the model with the best parameters, as mentioned below:





We have now trained a 90% accurate XGB model that can predict whether a customer would be inclined to subscribe to a term deposit or not.

The model can now be used to identify potential term deposit subscribers to carry out targeted marketing activities resulting in reduced marketing costs.

Should XG-Boost be used all the time for classification problems related to the banking domain?

Based on the no-free-lunch theorem, “There exists no single best optimization algorithm”. So every problem should be approached with a fresh mindset and all possible algorithms available should initially be tested out and, finally, the best performing algorithm should be selected and further tuned to obtain the best results.

When not to use XG-Boost?

It has been observed that XG-Boost algorithm tends to underperform in the following cases and hence should be avoided while dealing with problems related to the following:

  • Computer vision

  • Natural language processing

  • Tasks involving extrapolation

What problems related to the banking industry can be resolved using the XG-Boost algorithm?

Since its introduction, the XG-Boost algorithm has not only been credited with winning numerous modeling competitions but also for being the driving force for several cutting-edge industrial applications. The XG-Boost algorithm can be leveraged to solve the following problems that are related to the banking industry:

  • Potential Customer Prediction

    • Prediction of potential customers to target specific services via marketing

  • Credit Default Prediction

    • Predicting which customers would default their upcoming debt repayment

  • Customer Churn Prediction

    • Predicting which customers are more likely to churn out of a particular service, such customers can be flagged and targeted with schemes in order to retain them

  • Fraud and Anomaly Detection

    • Frauds and anomalies related to financial transactions can be detected using XG-Boost as a classifier

Clairvoyant Perspectives

Tags: Artificial Intelligence

Fill in your Details