Unlocking Predictive Analytics with PECAN's Generative AI: A Comprehensive Guide
Explore how PECAN's AI-driven predictive analytics tool simplifies complex data science tasks, making it accessible for businesses to predict customer churn and more.
File
How I Build Predictive Analytics Models With AI
Added on 09/30/2024
Speakers
add Add new speaker

Speaker 1: Predictive analytics. If you think it sounds complicated, that's mainly because it is. In most cases, building predictive models involves some fairly complex calculations and requires special tools. So you might also think that those tools tend to be the realm of the data scientist, putting predictive analytics out of the reach of the average business due to a lack of said data scientist or because it was beyond their budget. Well that might have been the case a few years ago, but not so much anymore. With the advent of artificial intelligence and machine learning becoming available to all, there are now some much more accessible solutions. One of those being PECAN. In this video we'll take a look at what PECAN offers in terms of predictive analytics using generative artificial intelligence, or Gen AI. Let's jump in. Hello and welcome to Learn BI Online with me Adam Finer, helping you do more with data. Predictive analytics isn't something I've really covered on this channel, so when PECAN approached me asking if I'd like to check out their tool, I took it for a spin and decided it was something that you guys might be interested in too. Full disclosure, PECAN are very kindly sponsoring today's video. I'm gonna be demoing their platform for you, but they haven't told me what to say so it's completely my review. If you want to check them out for yourself there's a link in the description below. If at this point you're asking yourself what is predictive analytics, it's essentially using data, statistical algorithms and machine learning to predict future behavior, trends and outcomes. So this being a business intelligence channel, what are the kinds of predictions that businesses want to make? Well there are a few very common use cases. Things like revenue prediction or churn, which is predicting how many existing customers might stop using a product or service in the future. Churn rate is the use case we're going to look at now using PECAN. So let's jump onto my computer. Here on PECAN's website it says reimagine machine learning with PECAN's predictive gen AI or generative artificial intelligence. Level up your skills and impact with machine learning. Start your AI journey today. It also says zero data engineering, no data scientists needed and coding optional, which sounds great. You can sign up here for a 14 day free trial and when you do and you log in you'll be greeted by PECAN's AI assistant who says I'll assist you in formulating a predictive question. I'll then create a sequel notebook to build a training set. So what would you like to predict? Well in our case I want to predict a customer churn. So I'll send that and the reply comes back. Great I'd be happy to help you solve your customer churn predictive use case. For example a predictive question could be predict weekly which customers will stop making purchases in the next seven days. This is just an example and we can refine it to better suit your needs. In order for me to help you phrase your own predictive question all you need to do is to answer four simple questions. Ready to get started? Let's start with the first question. Who or what is the subject of your prediction? In this case is it safe to assume that the subject is your customers? Well that is correct so I'll send yes. Great so we're predicting something about your customers. Now let's move on to the second question. What is the specific activity or event that you are trying to predict about your customers? In the context of customer churn this could be something like customers will stop making purchases or customers will cancel their subscription. Could you please specify the activity you're interested in predicting? Well it's stop making purchases. That's what we're interested in so we'll send that. Perfect so we're predicting whether your customers will stop making purchases. Now on to the third question. How far into the future do you want to predict this activity? For example do you want to predict if a customer will stop making purchases in the next 7 days, 14 days or perhaps a month? Please specify the time frame. Well for us we want a month. Great so we're predicting whether a customer will stop making purchases in the next month. Now for the final question. Do you want to predict this on a recurring basis like daily, weekly, monthly or is there a specific event after which you want to predict? For example do you want to predict this every week for all customers or only for customers after they make a purchase or after they sign up? Well I actually want to predict this on a monthly basis so I'll send monthly. Excellent so you want to make this prediction on a monthly basis. Here is your predictive question. Predict monthly which customers will stop making purchases in the next month. Exciting you made it. You can use this question as is or we can refine it further. Would you like to add more details to this question? No for me that looks good so I'm going to hit looks good. Fantastic in order to create a predictive SQL notebook that fits your data requirements we need to review your data. Sounds good. Please note the PECAN strictly adheres to data security compliance standards being ISO 27001 and SOC 2 certified. Sure let's continue with my data. Let's talk data. To predict customer churn we need to have historical data about your customers purchase behavior. Do you have a table that contains records of your customers purchases? This table should include a unique identifier for each customer like a customer ID and the date of each purchase. If you have such a table could you please upload it as a CSV file using the attachment button next to the chat input line. So that's this one here I'll hit that I've got this transactions file here so we'll upload that and we'll send it. So PECAN analyzes the file and finds all the different columns that are in the source file and also attributes a data type to each. So we need to say this looks good. Great now let's identify the necessary columns in your table. We need to find one the column that holds the date of each purchase this is mandatory as PECAN cannot build a model without this column and number two the column that holds the unique identifier for each customer this is also mandatory. Could you please tell me the names of these columns in your table? So we have the date column here and right at the top we have the customer ID column so I'm just going to say date and customer underscore ID. Perfect so we have the date of each purchase in the date column the unique identifier for each customer in the customer ID column. Just to confirm are these the correct columns that we should use for the prediction? Yes. Wonderful here's a summary of the information you provided. Okay so we've got the predictive question that we formulated a minute ago and information about the data schema the table and the columns that we need. So if that all looks good we're going to hit generate notebook and it'll start the process of generating the predictive notebook. Now this might take a minute or two so let's jump forward to once it's done. And here we are in the generated notebook or nut book as we're working with PECAN of course. So using this PECAN notebook you'll be able to train an ML or machine learning model that answers your predictive question. The one that we formulated a minute ago. So the cells below contain queries SQL queries that were automatically generated based on your predictive question. Running them will create a training set using PECAN's format comprised of two parts. So the two parts there's a core set which is a table with historical examples of customers who did or did not stop making purchases and attribute tables. So additional tables with relevant information about the customers. So if we go down here we see finding relevant customers for our core set. We're trying to learn how to make a monthly prediction on customers. As a basis to learn from our training set first needs to have a table with a row for each pair of customer and each month. So this first query here says this will return all days weeks or months in the given time frame. And you can run these different queries independently. Let me just run this one here and the result or at least a preview of the result will appear below here. And this the name being given to this cell is monthly sampling helper table. Okay if we keep going down next we'll write a query that will find relevant customer per sampled data. So that's this query here. Now obviously you don't need to know SQL you can just run these queries but obviously it does help to understand SQL a little bit to know what's going on with these queries. Let's just run this. There we go. Success. The label our positive and negative examples. In order to train a model we need to give it both positive and negative examples. In our context the positive examples are customers who stop making purchases in the next month after each sample month. So this query below will now find positive and negative examples from historical data. Let's run this. And there we go. Did the customer stop making purchases within next month and for each customer ID we've got yes and no. If we keep going down additional useful data to help train the model. As mentioned it's important to include additional tables with information about our prediction subjects. At PCAN we call these attribute tables. We used your data to create a sample attribute table. So that's this one here attribute one using the file that we uploaded for additional data features. And we can see here it's taken some of the other fields from that file. Let's run this query. And there we go. It's successfully run that query too. If you want you can just click this button here to run them all but if you want to sort of understand step by step what's going on and the results that are being returned then you can just do one by one. So and that's it. We're now ready for PCAN to train the model. Let's review what we did. So we created a table the core set that samples the history of customers determining whether they stopped making purchases or not per each sample date. Which serves as positive and negative examples the model can learn from. And then secondly we added additional tables the attribute tables that provide more information for each of the customers up to each sample date. This extra data enhances the models ability to infer patterns and make accurate predictions. Makes sense. Exciting. The final step would be to click train model at the top. That's this purple button here. Let's hit that and we have two options in terms of training mode. We have fastest and production quality. Obviously production quality takes several hours so for our purposes we're going to stick to fastest data mapping and we're just going to validate and train. Obviously this is going to take a while so let's jump forward. Once that's run we end up in the model tab where first off we can see the models evaluation. In terms of its performance we can see it has a precision of sixty six point four percent. Which is 2.6 times better than rule-based logic and 3.9 times better than a random guess. We can see other things like the performance details, threshold configuration and also the top contributing columns to the model predictions. We can see here that payment recency is contributing sixty nine point nine percent of the models prediction. So we can see here this column significantly dominates your models prediction suggesting possible over dependence and potential issues. We'll sort that out in a minute. So in the model output tab we can see a sample of the rows. So in terms of the customer and the probability, the classification and the veracity of the result. So let's go back to queries. We can see here that notebooks are locked once a model is sent to training. So if we did want to edit this model in any way perhaps by adding more data we would need to duplicate it. Which I can do here or I'll just go back to this screen here where we can see the notebook we've previously created. I'm going to click here and select duplicate and open up this new copy. So in terms of importing or adding new data we have this part section here where we can choose to add new data. There's this customers file. In fact I've already included that here. So I can generate this as an attribute. This will create a new cell. So we can see here that this new customers information could help better train the model. So when we run all this new data will be included. So that's adding CSV data. But what about other data sources? Well if I come down to here I can choose to add data and create a new connection. And we can see a menu of all of the different data sources that we have at our disposal. So we have relational databases like SQL Server and MySQL. We have data warehouses like Google Big Query and Amazon Redshift. And other data sources like Salesforce and HubSpot. Also we can see coming soon Google Ads and Greenplum. If you don't see your data source on this list you can click here and suggest a new one for development. So we've seen how to predict customer churn. But what other solutions are available from Pecan straight out of the box? Well in terms of user acquisition we've got things like marketing mix modeling, predictive campaign ROAS or return on ad spend, campaign optimization using scan and lead scoring with predictive analytics. For customer engagement as well as customer churn we've got customer win back and upsell and cross sell. And in terms of supply chain we've got demand forecasting. Now if you're worried about not having any data to practice this with not to worry Pecan has you covered. If we go to their main page here we actually have two tutorial notebooks that you can play around with. So don't hesitate to do that. So a massive thank you to Pecan for sponsoring today's video. It really does help out the channel and keeps the content coming. If you want to check them out which I highly recommend you do I'll leave a link in the description or just head on over to pecan.ai. Thanks so much for watching and I'll see you soon for another video. Until then, bye.

ai AI Insights
Summary

Generate a brief summary highlighting the main points of the transcript.

Generate
Title

Generate a concise and relevant title for the transcript based on the main themes and content discussed.

Generate
Keywords

Identify and highlight the key words or phrases most relevant to the content of the transcript.

Generate
Enter your query
Sentiments

Analyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.

Generate
Quizzes

Create interactive quizzes based on the content of the transcript to test comprehension or engage users.

Generate
{{ secondsToHumanTime(time) }}
Back
Forward
{{ Math.round(speed * 100) / 100 }}x
{{ secondsToHumanTime(duration) }}
close
New speaker
Add speaker
close
Edit speaker
Save changes
close
Share Transcript