All of us surf the internet on the daily basis. Almost every website we meet on our journey tries to show some relevant data based on our preferences. It could be related articles on Medium or related posts on Facebook and so on. Least of us think about how does this relevant article or post actually become a relevant one? Let’s try to find it out today.

First of all the website should know your preferences and to do so it should collect some statistical data about your previous journey and try to predict your desire. It can be done with some assumption error by straight mathematical calculations. Or, as an alternative, it can be done by a neural network regression process. Both ways can be good, it depends on the shape of the statistical data the model can obtain. We are going to consider the second approach using artificial intelligence based on neural networks.

The format and shape of the marketing statistical data were discussed in our previous article. Basically, it is an array of categorical data showing the previous activity of a website visitor. For example, the age range of a visitor, his location area, his marital status, job title and so on. If we are trying to predict the interest of a visitor to some particular good or brand or category it is better to have some statistical data related to that good or category. For example, if we would like to understand will it be interesting for a visitor to interact with an example good “iPhone X plus” it could be useful to have statistics like “Did a visitor interact with any good of a brand Apple in past?”, “If yes, then how many times?”, “Did a visitor buy any good of a brand Apple in past?”, “What kind of good was it?” and so on. I hope everyone got the idea, to predict some particular visitor’s interest we need some statistical data related to that particular interest.

Now, to build a neural network model we, first of all, need this statistical data, and second, teach our model to predict the results based on the data. Preparing the data that can be used as a learning dataset is another challenge and we will cover this in our next article. Today we are going to build a model capable to predict the result based on marketing statistical data.

There are few examples of marketing datasets available on the web and one of them is “Bank Marketing Data Set” from “Center for Machine Learning and Intelligent Systems” (https://archive.ics.uci.edu/ml/datasets/bank+marketing). This dataset is a good example of marketing data used to predict the client’s interest. In that particular example, the client subscribed to a term deposit (or not subscribed to one). If we can train the neural network to predict the result by that simple dataset we can use the same model to predict other marketing decisions based on marketing statistical data in general.

The dataset has 20 input variables including client’s data like age, job, education, marital status, and few statistical numbers like “number of contacts performed during this campaign” or “number of days that passed by after the client was last contacted” and so on. As a result, the dataset has just one attribute — has the client subscribed to a term deposit or not? The dataset has 41188 examples to teach the neural network and 4119 examples to validate the accuracy of prediction.

A good candidate to solve the task by a neural network is a Deep Neural Network Classifier. It is a multi-layer neural network for which all nodes of one layer are fully connected to all nodes of the next layer. It is also possible to drop out some data by an appropriate coefficient to prevent the over-fitting of the model (when the model over learnt and predict example dataset too well but cannot predict an example out of initial dataset).

After a number of experiments, the UBEX Data Science Engineers found the good shape of the Deep Neural Network with the best prediction rate. It is a neural network with 4 hidden layers of 120, 720, 180 and 60 units respectively.

Currently, the model can predict that the client doesn’t subscribe to a deposit in 96.6% of cases. The overall model accuracy is 91.6%. It is a good result and the neural network is capable to predict the client’s interest with a high chance.

On the other hand, this example dataset has a few input attributes. In the real case, the website can gather much more statistical data which will lead to better accuracy of prediction meaning the better recommendations can be selected or better advertisement can be shown for a particular website visitor.

The model described in this article is a basis for a neural network core of the UBEX project. The main goal of the project is to show the advertisement the visitor would like to see or don’t show it at all.

If you would like to know more about the project, please follow the project’s website https://www.ubex.com

The complete working code of the neural network described in this article is available on the GitHub https://github.com/ubex-ai/bank-marketing-estimator