Predictive scoring
Overview
Intempt platform provides functionality to upload trained Machine Learning models and run them for serving predictive attributes from trained model artifacts and pre-processed data functions.
If the model was imported successfully, you can create predictive attributes based on the deployed model. After that, all active organization users will receive an attribute value calculated by the ML model.
The predictive attribute can be further used in segmentation to create highly targeted segments and engage the users.
Workflow
1. Data exporting
- Export data from your database
2. Building the ML model
- Do an exploratory analysis of data
- Load required data (joins, filters, aggregates, etc.)
- Pre-process the data
- Fit the model
- Pack the model with data preprocessing code, and libraries used in a single .zip file
3. Loading the model
- Upload the model and map aggregated data to the collections in Intempt
- Intempt runs predictions on this model using newly arrived data
- New predictive attribute is created
Building the ML model
Intempt gives the flexibility to data scientists to allow them to use any ML tools they are already familiar with (for example, load from BigQuery, process with Python, fit with Python). The only restriction is that the resulting model should be packaged in a .pkl file (pickle library) and coded in Python.
To load a model in Intempt, you will need to create a packaged .zip file with:
- .pkl file containing the data columns from Intempt used for the model.
- .pkl file containing the pre-process or aggregations performed on the data from Intempt.
- .pkl file containing the transforms applied on the pre-processed data from Intempt.
- .pkl file containing the model itself after training.
- Libraries used for your process (requirements.txt)
Creating a Predictive attribute
Importing the data
If the data that your model was trained on is not yet uploaded into Intempt platform, you need to import this data prior to starting to create the predictive attributes. We recommend importing your data via the following sources:
- CSV upload
- Google Sheets
- HTTP API
Loading the ML model
Under the Predict object, locate and click on the Create model button. Add a descriptive name for the model.

Upload the packaged ML model, it should include:
- .pkl file containing the data columns from Intempt used for the model
- .pkl file containing the pre-process transform performed on the data from Intempt
- .pkl file containing the model itself after training
- libraries used for your process (requirements.txt)

Dataset mapping
To fit the changes done in the pre-processing, you need to do the data loading expressed through Intempt's objects - the dataset should be exactly the same as used during model building. This requires mapping the processed columns (that were used to build the model) to the Intempt collections.
In order to do that you need to:
Option A
Have a source that already has the collections mapping with data columns used for the model (usually works if you collected/exported all data through Intempt).
NOTE: You will need to map processed data columns with collections in the selected sources.
Option B
Create a source and respective collections with fields based on the aggregate data. This is the usual case if you combine custom data (not present in Intempt) during data processing/aggregation. Here you will need to create custom collections with respective fields and object types mapping to the data columns.
NOTE: You will need to get the full breakdown of the fields that were used in to aggregate the data columns.

Creating a Predictive attribute
Under the Attributes object, locate and click on the Add new attribute button. Add a descriptive name for the attribute.

Choose the attribute type:
- Users
- Accounts

Select the uploaded ML model from the list.

In the final step, you need to define the output schema. Schema depends on the ingested model - if it is a simple classification model it can be boolean (for example, customer churned - yes or no). However, more complex models can require different schemas with array and record types.

Using Predictive attributes
User details page
You can view predictive attributes on the user details page.

Segmentation
In addition, you can use the ML-based attribute in the segmentation engine to target users based on the defined attribute range.
Recommendations
If you create an attribute based on a recommendation ML model you also display dynamic recommendations on your site or insert recommended products into an Email or SMS templates using Liquid tags.
Updated 4 months ago