Be the first to read our first Ebook!

In the Age of AutoML, we are all Data Scientists! | Artificial Intelligence (AI) has become increasingly essential to our daily routine lives.

AI Marketing use case with SmartPredict AI platform

Published on May 17, 2021 by Haingomanitra H. F.

Artificial Intelligence is now mainly adopted in the business marketing strategy for predictive analytics, tracking customer movement, to group segmentation. 

That's not all. AI can improve both the precision and effectiveness of their marketing campaigns for the better. 

In this article, we will run an end-to-end AI and data science marketing use case with SmartPredict AI platform in the easiest way. The AI project predicts if your product or service will probably attract the prospective client according to their profile. In other words, this AI in Marketing solution is useful for lead scoring. 

This article's outline : 

  • The project overview
  • Creation of the sample project 
  • Training and evaluating the ML model
  • Putting the trained ML model in production ( with the fully deployed customizable pipeline)
  • Getting the prediction
  • Tips to realize your marketing AI project.

Let's dive in!

What is this marketing AI project about?

The project we are going to work on together is a Machine Learning (ML) project able to predict the result of a marketing campaign. 

To accomplish this, we will train an ML model with data that contains customers' information and the campaign method that will have a causality on the product purchase. 

In this case, we use a free dataset from the UCI ML repository: the Bank Marketing dataset with 11 162  lines or entries and 17 columns or variables. This data is related to direct marketing campaigns (phone calls) of a Portuguese banking institution with the classification goal to predict if the client will subscribe to a term deposit.

5 first lines of the dataset:

Note: For your own Marketing AI project, you'll use your own dataset. We'll give you tips for this at the end of this article but let's deal with this Bank Marketing project to show you how easy it works.

Let's follow the following steps to complete this AI project :

  • first, we create the project, 
  • second, we train the ML model in the Build space (with a customizable flowchart)
  • third, we go to the Deploy space to put the trained model in production (with a fully deployed customizable flowchart)

And we test and get predictions in Predict space.

Go to the SmartPredict platform to start.

Creation of the sample of the project 

There is already a sample project for this dataset on the platform. Follow the indication below to create one.

Creating Bank Marketing Sample project:

If you want to start from scratch, please check out this tutorial link.

Training and evaluating the Machine Learning model

As it's a sample project, SmartPredict generates the ML workflow (flowchart) to train and evaluate the AI model in the Build space. In this flowchart, we train and evaluate the Random Forest Classifier model with the "Accuracy" as a metric.

Note that this is a customizable flowchart: you can change modules’ configurations, and add some modules from the module menu. Furthermore, you can create and use your own module with the Custom modules.

Thus, you can train other ML models defined in Core Module or your own AI model.

The flowchart to train and evaluate the ML model:

Click on the "Play" button at the left to compute all these processes and find the value of the accuracy metric in the Build log.

The accuracy metric value = 0.893:

When it states success, click on Deploy to put the trained model into production.

Putting the trained ML model into production

In SmartPredict, we deploy a deployment flowchart as a web service to put the trained model into production. 

 For this, you have two options :

  • either the deployment flowchart is generated automatically by translating the flowchart1 in the Build space,
  • or you can create the deployment flowchart.
    The option which generates the deployment flowchart:

If you choose the first option, you get the deployment flowchart in the Predict space.

Just, click on the rocket icon to fully deploy this flowchart as a web service. Therefore, the trained model is put into production.

The deployment flowchart:

Note: For experts, the deployment flowchart is also customizable: modules in Core Module, Custom Modules can be used. Thus it is easy to add post and preprocess data even after deployment.

Please check out this tutorial to learn more about the deployment flowchart.

For software engineers, an API is generated automatically in the Monitor space used to call the deployed flowchart.

Otherwise, when it is ready, go directly to the Predict space ( click on Predict) to get a prediction from the deployment flowchart.

Get prediction in the Predict space

Once there, create the new request, enter the information of your new leads and get a prediction if he will subscribe to a term deposit.

Note that the variables to be presented to the deployed model must be the same during its training. Thus we enter the value of the 16 attributes (the target is not included) about the new leads.

Thus create and send new requests as you want in: 

  • in json 
  • in json file
  • or in your dataset format
    Click the send icon on the left to get predictions.


    Getting prediction in the Predict space.

Voilà! You’ll get a prediction in front of you : 

  • “0” means that the client will not open the term deposit account
  • “1” means that the client will open the term deposit account

Congratulations, you've successfully completed your AI projects with SmartPredict. 

Note you can see the prediction process through the deployment flowchart in Deploy space. So you can update it at will when errors occur during the prediction.

Tip to realize AI in Marketing

To realize a marketing project similar to this Bank marketing project, you just have to upload your dataset and use this sample project as a skeleton for your Flowchart in the Build space. 

And some modifications on the modules especially on the data preprocessing according to your data are necessary. 

Otherwise, you can check this tutorial to help you in your AI project from scratch with SmartPredict.

Before you leave

You have successfully completed AI in Predictive Marketing with ManualFlow in SmartPredict.

Discover also Autoflow with which you can get accurate forecasts for your future sales for instance. It’s a SmartPredict new feature based on AutoML 2.0 for more simplicity in the accomplishment of your AI projects.

See you soon for other AI projects with SmartPredict.