All Collections
Creating a Model
Build your first Predictive ML model
Build your first Predictive ML model

Blaze through the process of creating an AMAZING predictive ML model using Pecan's unique features - for pros and beginners alike!

Ori Sagi avatar
Written by Ori Sagi
Updated over a week ago

Welcome to the world of predictive analytics with Pecan!

This comprehensive guide is designed for beginners in machine learning, walking you through each step of training a model on our platform.

Let's demystify the process and make your data work wonders for you โœจ

Step 1: Engage with the Predictive Chat

Your journey begins with a conversation with Pecan's Predictive Chat. It's programmed to ask four essential questions to shape your predictive question accurately. These questions cover the following:

  1. The focus of your prediction (e.g., sales, customer behavior)

  2. The specific activity you're predicting (like purchase frequency)

  3. The time frame for your prediction (next week, month, year)

  4. Whether the prediction is for a one-time event or a recurring activity

Simply describe your business use case and answer our Predictive Chat's questions, like answering a colleague, and it will take care of everything for you.

Refining Your Prediction

Our Predictive Chat isn't just a questionnaire; it's a guide. It offers further assistance to refine your predictive question, ensuring it aligns perfectly with what you aim to achieve.

Tip ๐Ÿ’ก

To launch the Predictive Chat, go to your home page, or click + New predictive flow from the predictive flows tab.

Once satisfied with your predictive question, click Looks Good.
โ€‹

Using your data or mock data

Got a predictive question you're happy with? Awesome! Before diving into the modelling stage, you've got two paths to choose from:

  • Using your own data - You can easily map an existing connection (if you've already set one up) or upload a CSV file directly in the chat.
    This way, you're all set to see how your data comes to life in your custom-generated SQL notebook.

  • Exploring with mock data - Prefer to dip your toes in first? Opt for mock data, and we'll generate a notebook filled with it. This is a fantastic way to get a feel for the SQL queries and tinker around with the notebook. Keep in mind, though, that with mock data, you won't be able to train a model. But if you want to dive deeper later, you can always map your actual data, or create a new notebook.


Step 2: Generating the Predictive Notebook

The Predictive Chat will now create a unique Predictive Notebook (Pecanโ€™s specialized SQL notebook) tailored to your business use-case.

This notebook will contain your predictive question, as well as SQL queries that are used to create a training set for your model, along with a detailed explanation about each and every query.

Accessing your Predictive Notebook

Post-generation, access your Predictive Notebook by clicking Go to the Predictive Notebook.

This is where the real magic begins! โœจ

Your Predictive Notebook will always be waiting for you under the "Predictive flows" tab.

Understanding the Predictive Notebook Structure

Your Predictive Notebook is divided into two key parts:

  1. Core Set: This table is your model's foundation, containing historical examples of the behavior you're predicting (e.g., transactions, sales, etc.). The model has to learn from the past to make predictions, so this is where you tell it what to learn from.

  2. Attribute Tables: These are supplementary tables providing additional relevant information (like customer demographics, SKU details, etc.) that enrich your model. These tables should contain all the information for the model to understand the full story of each one of the Core Set's examples.

For example, the Core Set might tell the model it needs to learn about John Smith's churn event from November of 2022. The attributes will add that John was living in NYC, he is 32.4 years old, he opened 12 support tickets in October, etc.


Step 3: Preparing your Core Set

Go through the logic process of creating the core set

In your Predictive Notebook you will find several SQL queries that build your Core Set in a logical step-by-step process. Before each query, you will find a clear explanation of its goal and the reasoning for it.
Go over the queries, run them to see the results and make sure you understand the purpose and reasoning behind each step.

Important ๐Ÿ‘€

Each cell relies on the table that was generated in the cells before it. You can see that it uses previous cells' names in the SQL.

Make sure to run all the cells above the one you're currently working on so they generate the required tables, your current cell can use the tables to build its own.

You can also click Run all at the top of the page to run all of the cells by order.

Finalizing the Core Table

Once you finished mapping and running all the cells that lead to the Core Set, run the Core Set and ensure the core table cell accurately uses your data.

This is crucial for the model to learn correctly from past behaviors.
โ€‹

Finally - remember to mark your table as the Core Set:


Step 4: Adding attribute tables

Creating and Marking Attribute Tables

Right below your Core Set, you'll find two templates to add attribute tables.

Follow the templates to create at least one attribute table, marking it as an "Attribute table" in the Predictive Notebook. These tables add depth to your model and contain the data it will use to uncover hidden patterns and create predictions!

TIP ๐Ÿ’ก
If you used our chat to map your data, it will generate an attribute for you - but you can always add more!

Adding Multiple Attribute Tables

For a richer model, feel free to add as many attribute tables as necessary. The more the merrier! Include any data you have, even if you think it's not going to be helpful for the model.
Pecan will do the heavy lifting for you and will automatically do some feature selection and feature engineering to make the most out of your data.

Just remember to mark all the tables you want to use as attributes:
โ€‹


Step 5: Training Your Model

This can only be done if you used your own data to generate the notebook.
โ€‹

Please refer to this article if you created a predictive notebook using mock data and would like to map it to use you data.

Once your data is mapped and attribute tables are in place, hit the 'Train Model' button on the top right corner. You will get to this panel:
โ€‹

Map the Core Set and attribute tables

Make sure the correct table is marked as your Core Set, and that the columns are mapped correctly.
Also, ensure all the attribute tables you wanted to use appear as attributes. If some of the attribute tables you've created are missing you can always click + Add attribute and add it.
It's always a good idea to have a second look here, even if you already mapped your tables when working in the Predictive Notebook.

Validating Data Tables

Before training begins, Pecan will validate your tables. This step ensures your data is correctly formatted and ready for model training. Any discrepancies will be flagged for correction.

Send the model to train

With validation complete, youโ€™re ready to send your model for training.

This is where Pecan's algorithms learn from your data to make future predictions.


Conclusion

Training a model with Pecan is a great first step into the future of data analytics.

Each stage is designed to be clear and understandable, even for those new to machine learning. Your data has stories to tell and predictions to make โ€“ and with Pecan, you're the narrator.

Remember, the Pecan team is here to assist you at every turn - you are always welcome to reach out through our live chat.

Still reading?

Did this answer your question?