Skip to main content
Add predictions to new data, using saved ML models. This template allows you to load a pre-trained ML model and apply the model to new records in a table, to make predictions on a scheduled basis. The predictions are written to a column “Prediction” in the same table in Peliqan. In this tutorial we’ll use a Lead Conversion prediction model, you can modify the code to work with other ML models as well.

Import required modules

Load new records

We’ll load records that do not have a prediction yet. Make sure to add a “Prediction” column first in the spreadsheet view of the table.

Data Preprocessing

For predicting, we have to prepare the data in the same format as it was trained on.
It’s recommended to add try to block to capture if there are no records to update other wise it will throw errors in the future.

Load the model & predict

Write predictions to table

We can accomplish this using the update_cell method from the Peliqan module pq:

What’s Next

  1. You can make real-time predictions on new incoming data and send alerts on slack if the model makes a prediction above a certain threshold. Learn more about sending critical notifications to slack.
  2. Using Peliqan you can create an app for business users to consume the model you have made in a simple and intuitive UI. Learn more about creating apps for users to consume your model.