How can we understand if a customer will be a good or bad payer with the AI? tutorial

medium economic 1 day

Today we are going to understand how can we use a Naive Bayes algorithm (producted by our team) for detecting if a customer is a bad or a good payer.

This algorithm could predict if a given customer is a bad or good payer from the data history of the classification. The data history represents the input of the algorithm. More the input is detailed and more efficiently is the predict.

Let’s take an example,

we extract from a “generic” informatic system, a CSV with these columns. Each column represent a character. For example in the first column: BIG, MIDDLE, SMALL company (we are talking about customers). In the other column if we are selling PRODUCT or SERVICE. In the other column the price of the sold, the time of the first contact (this tell us if a customer is fidelizated or not) and the classification PAID or UNPAID.

Training Set – input file for Naive Bayes calculation

Once finished to compile the file we are going to import it into on-line service

The import of the file has prepared the algorithm with the training set. The next step is to predict what we want.

For example we want to predict if in a new “sold” we could have issue about the payment from the customer. For doing this we prepare 2 case study:

  1. BIG, SERVICE, STANDARD, 45000, 34: it means that a BIG company has bought an our SERVICE with a standard configuration and price of 45K. The company is an our loyal customer.
  2. SMALL, SERVICE, CUSTOM, 150000, 1 : it means that a SMALL company has brought a service with custom configuration with 150K of price cost. The company is the first time that works with us.

At this moment we are going to put into TEST section the informations described before:

Questa immagine ha l'attributo alt vuoto; il nome del file è Schermata-da-2019-04-26-17-05-50-1024x649.png

Prediction Set for Naive Bayes

Press start and let’s show the predict

Questa immagine ha l'attributo alt vuoto; il nome del file è Schermata-da-2019-04-26-17-16-07-1024x649.png

After a math calculation about the Naive Bayes algorithm, the system show you the result of the predict.

Case 1, the predict is PAID,

Case 2 the predict is UNPAID.

These predictions are based from the history of the training set. If the company has a good history of selling custom service to small new company then it’s probable that, for the case 2, the result of predict will be PAID!

Leave a Reply