Article • 2024-09-26 • 4 min read

Part 2 - Marketing Science with BigQuery Canvas: A No-Code Approach to Churn Prediction

Surya Kunju
Surya Kunju
AI Systems & Applied Machine Learning • YouTube: @suryakunju
Part 2 - Marketing Science with BigQuery Canvas: A No-Code Approach to Churn Prediction
Ready to unlock the true potential of your marketing data and transform your customer retention strategies?

In Part 1 of this series, we demystified the process of finding the right data with the intuitive combination of BigQuery Canvas and Gemini. Now, prepare to dive even deeper and harness the magic of Marketing Science with a no-code approach to churn prediction.

Imagine effortlessly building powerful predictive models that reveal which customers are most likely to leave, allowing you to take proactive steps to keep them engaged. No complex coding required! We'll explore how BigQuery ML and generative AI democratize access to advanced analytics, empowering data scientists, engineers, analysts, and marketers alike with an intuitive and powerful tool, regardless of their technical expertise.

This seamless integration of data querying, feature engineering, and machine learning model development all within a single platform opens up a world of possibilities.

But first, we need to lay the foundation for our predictive model. In this article, we'll first create a 'flat table' – a crucial step in preparing your data for machine learning magic and then prepare the data for Machine learning model to use it as an input
Step 1 : Join the output queries to get a single FLAT table, which is generally what you need when you want to build a machine learning model

The above joined table now has the following Key variables 

You'll notice we don't have a readily available "Churned" variable. This is where the magic of data engineering comes in, and where your marketing expertise is essential! To build our churn prediction model, we need to define what "churn" actually means for your business. In this case, let's assume we want to identify customers who are likely to stop engaging with your website or app based on the number of days since their last visit. By pinpointing these at-risk customers, we can proactively engage them with targeted campaigns to prevent churn and increase retention.

With that in mind, we create a new variable called Churn. I would again use Gemini’s Gen AI capability to create SQL using Natural Language. 

With our labeled variable in hand, we're ready for the grand finale: building our machine learning model! And guess what? We can accomplish this incredible feat without leaving the comfort of our BigQuery Canvas or writing a single line of SQL. Get ready to witness the power of Gemini as we create a sophisticated classification model using only natural language. But first, a quick touch of data normalization and engineering to ensure our model performs at its best 🙂

And finally we take the big step of asking Generative AI to create a classification model (Supervised learning in action here!) 

And we got a strong output 

This model empowers marketing analysts to proactively identify and engage website visitors who are likely to churn. By integrating this predictive capability directly into their workflow, analysts can:

This real-time predictive capability allows for a range of targeted actions, such as:

By leveraging this model, marketing analysts can transform their approach to customer retention, moving from reactive to proactive and driving significant improvements in website engagement and overall business performance.

So folks, there you have it! Hope you enjoyed both the parts. Please let me know if you have any questions!

Want More Hands-On AI & Systems Deep Dives?

I publish weekly production architectures, live coding breakdowns, and technical analyses on YouTube.