Pecan’s Blueprint Editor is where you’ll transform historical data into an AI-ready dataset that your model can train itself on and continually make predictions for.

This is done by creating SQL queries in a blueprint. Pecan uses these queries to automatically generate AI-ready tables that can be fed into your model. Your model is then able to interpret the data, learn from it, train itself, and make predictions for future datasets.

The tables generated by these queries (also known as ETA tables) essentially communicate your predictive question through your data. For example, your blueprint might tell the following story: “Here's what a churned customer looks like in the data. Based on this, how likely is it that other customers will churn?”

To guide you through the Blueprint Editor and how to use it, this article contains an overview of each of its sections.

SQL Editor

The “SQL Editor” tab is where you’ll prepare queries that define the Entity, Target and Attribute components of your dataset, generating input tables that tell Pecan what to look for and measure.

What’s important to remember is that these SQL queries are not your model itself, but rather, a way to make your data machine-readable.

Some important things to note:

  • Clicking Keyboard shortcuts will reveal shortcuts that make it easier to build your SQL queries.

  • Clicking Compiled will preview how your final query appears once populated with the contents of the variables used.

  • The syntax “-->” denotes a common table expressions (CTE) that can be used to reference the related result set within the query itself. It also serves as anchor text within the query, appearing as a clickable subitem in the left-side panel.

Building ETA queries

In the Blueprint Editor, clicking on each of “Entity”, “Target” and “Attributes” will open up the relevant SQL queries that define your predictive question. The question you wish to answer, and thus the model you wish to create, determine the “ingredients” that go into building these queries.

For a deeper dive into building Entity, Target and Attribute queries in the Blueprint Editor, see Building your ETA queries with SQL.

Or, for an overview of how to work with the Blueprint Editor and build queries for specific use-cases, go to:

When you’re finished building a query, click Save and run to generate an input table that will be used to train your model. Each query may run successfully, or you may encounter an error that needs to be resolved.

Once you’ve successfully run all three queries, you have an AI-ready dataset, as represented by input tables at the bottom of your screen. Click Create model so Pecan can begin training, validating and testing your model based on the provided data. (At this stage, you’ll also be able to configure some advanced settings.)

Common errors when running a query

  • A syntax error related to the way your SQL query has been built

  • A runtime error, which may result from an issue Pecan’s server infrastructure

  • A validation error, which indicates that a problem in the table or data will cause the AI process to fail

    • For example: having duplicate columns or rows, lacking a particular column, an imbalanced distribution of records over time, etc.

Schema

This panel displays all of the tables that are available for you to use in your model. They are available because you previously connected Pecan to their parent data source and imported them.

Variables

Variables are customizable properties that can be injected into SQL queries. They are defined per blueprint and are located in the right-side panel of the Blueprint Editor.

As you can see below, there are two tabs representing two different types of variables.

“Model variables” contain strings or numbers that impact how a query functions, and help define your predictive question – such as what to predict, for whom, for what period, and how frequently.

“Table variables” tell your model what data to utilize by acting as a placeholder for specific tables and columns that should to be queried from your dataset.

Variables can be added, edited or deleted. Each variable needs to defined in order for it to be functional. For example…

  • For the model variable “prediction_window”, you would indicate the number of days beyond the marker date you wish to make a prediction for.

  • For the table variable “transactions”, you would select the table that contains customer transactions, and map the particular columns you want to pull data from (e.g “customer_id” and “date”.)

    • Note that the mapped table, in order to be available, will need to have been imported to Pecan.

If you’re working from a template, your blueprint will already contain a list of preset variables that have default values (which can be adjusted).

At any given time, you can click the “Compiled” tab at the top of the Editor to see how the values of variables appear within your SQL.

For everything you need to know about variables – such as how to define and use them, how to create new ones, and what each preset variable means – see Creating and using variables.

Input tables (a.k.a. ETA Tables)

Once you successfully run each query, an input table will be generated and previewed at the bottom of the screen.

Together, your Entity, Target and Attributes tables make up a complete training dataset – ready to be fed into your Pecan model so it can begin to recognize patterns and relationships between data entries.

  • The Entity table sets out who and when predictions will be generated for

  • The Target table defines what you want to predict

  • Attributes tables provide information that forms the basis of your predictions.

Once you click Create model, the tables will be joined, and the training, validation and testing process will begin.

Advanced settings

Once you click Create model, you’ll be presented with Advanced settings that enable you to override automatic AI decisions in the pipeline.

Once you ready to proceed, click Create model to kickstart the model-training process.

Did this answer your question?