Training adaptive models
Adaptive models that you deploy to the Production environment learn quickly online from responses without any historical or sample data. Training adaptive models offline is not required or a best practice. However, for testing or demo purposes, you can train adaptive models with historical or sample data by using a Data Flow with a dedicated Decision strategy.
Offline learning of adaptive models
For testing or demo purposes, you can train adaptive models offline with historical data or sample customer responses. This method can be useful if you have a historical Data Set or simulated data and you want to perform further analysis, testing, or simulations. For example, when the recording of historical data is active for an adaptive model that runs in your Production environment, you can use this data to train another adaptive model with different settings that you want to test. Testing can help you decide whether you want to deploy an adaptive model with these settings to Production.
Online learning of adaptive models
Adaptive models do not require historical or sample data to learn. At the start of a project, no detailed historical data or Outcomes are available, sometimes referred to as the cold start in machine learning. The Adaptive Decision Manager (ADM) provides optimal handling for cold start scenarios through online learning. The ADM typically starts without any data and quickly updates the models from responses. Even when there is some historical data available, it is not a best practice to train adaptive models offline before you deploy them to Production, because it is difficult to get all the historical input data right, including real-time contextual and interaction history data, and there is always the threat of predictor leakage.
Use case
This tutorial explores the following use case:
A company that serves many customers wants to improve its method for identifying the best proposition for each customer. The company can make several propositions and has already acquired some information about its customers and interaction data in an external database. The Data Scientists at the company are developing and testing new adaptive models with different settings.
The CustomerResponse database column in the following table contains historical responses for a strategy in which each customer receives a group of propositions and can select only one (Insurance1, Insurance2, or Insurance3). When a customer accepts a proposition, the system automatically rejects the other two.
Sample database fragment with customer information and recorded response
GENDER | LastName | AGE | FirstName | INCOME | MaritalStatus | CustomerResponse |
F | Hensley | 66 | Mary | 165308 | Married | Insurance1 |
M | Knightley | 30 | Robert | 14663 | Single | Insurance3 |
F | Cage | 17 | Susan | 7250 | Single | Insurance1 |
F | House | 62 | Margaret | 21767 | Married | Insurance2 |
F | Bryant | 49 | Anna | 42517 | Single | Insurance3 |
The company needs a solution that takes the customer interaction data, feeds the data to adaptive models, and trains the models simultaneously. Adaptive models that are trained with this information can determine with improved accuracy which proposition a customer is most likely to accept.
To support training adaptive models offline for testing or demo purposes, you must create and configure two rules. The first rule is your decision strategy that references the propositions that you want to offer to your customers. This strategy must also reference an adaptive model rule that learns from each recorded customer response. The second rule that you must create is a data flow. The purpose of this data flow is to upload historical or sample data from a dedicated data set into the adaptive model data set.
Creating a strategy for training adaptive models
First, you must create a strategy that references multiple propositions for training adaptive models. This strategy must import proposition data and feed it to an adaptive model that learns with each received response.
For each proposition in the strategy, the system creates a model instance that you can view on the Model Management landing page in Prediction Studio or Dev Studio. For example, if your Decision strategy references 50 propositions, the system creates 50 model instances.
- In the header of Dev Studio, click .
- On the strategy canvas, configure importing propositions to the strategy (for
example, by using the Proposition Data strategy shape).You can use the single case test run to verify whether the proposition data is imported as expected.
- If the channel dimension or subject ID information for the strategy are not
already configured, specify the channel dimension and subject ID settings:
- On the strategy canvas, right-click, and then click .
- Right-click the Set Property shape, and then click Properties.
- Set the .pyDirection property to the direction that you use in the interaction with the customer.
- Set the .pyChannel property to the channel that
you use in the interaction with the customer.
- Set the .pySubjectID property. Set this property
only if .pySubjectID is not already the class key
of the Applies-To class of the strategy.
- Configure an Adaptive Model strategy shape:
- On the strategy canvas, right-click, and then click .
- Right-click the Adaptive Model shape, and then click Properties.
- In the Adaptive Model field, specify the adaptive model rule that you want to use in the strategy. Use one of your existing adaptive model rules.
- On the Outcomes tab, verify that you set the
correct outcome values for the adaptive model rule.The outcome values in the model must match the outcome values returned by the strategy (for example, Accept and Reject).
- Configure the strategy so that it updates adaptive models with historical or
sample responses:
- On the strategy canvas, right-click, and then click . Place the Set Property shape after the Adaptive Model shape.
- Right-click the Set Property shape, and then click Properties.
- In the Define action, target, and source section, click Add Item.
- In the Action field, select Set.
- In the Target field, enter .pyOutcome.
- In the Source field, set the adaptive model
outcome based on the database field that contains historical or sample
customer response.This example expression is valid only if proposition names are the same as historical or sample responses. The expression states that if the name of the proposition matches the value in the CustomerResponse database column, then the adaptive model outcome is Accept. Otherwise, the adaptive model outcome is Reject.
- Click Submit.
- Connect the strategy shapes.
- Save the strategy,
- Run the strategy by clicking .
Creating a data flow for training adaptive models
After you create your decision strategy, you must create a data flow that uploads your historical or sample data to each model instance that was created on the Model Management landing page. The source of the data flow is always the data set with customer interaction data.
The data flow must reference the decision strategy that trains the adaptive model that you want to improve. The destination of the data flow is always the Adaptive Decision Manager (ADM) server (pxAdaptiveAnalytics). If the class of the data set and the decision strategy referenced in this data flow do not match, you must convert the properties from the data set class to the strategy class.
- In the header of Dev Studio, click .
- To configure the Source shape, right-click the shape, and then click
Properties.
- Reference the data set with historical or sample outcomes that you want to use to train your adaptive models.
- Use the Preview option to preview the data set and test the connection.
- Click Submit.
- Optional: If the data set with historical or sample data and the referenced strategy are
configured in different classes, configure a Convert shape:
- Right-click the green plus sign, and then click Convert to add the shape to the data flow.
- Right-click the Convert shape, and then click Properties.
- In the Convert to field, enter the name of the class where the strategy for adaptive model training is located.
- Configure the property mapping to propagate properties from the source to the target class.
- Click Submit.
- Configure a Decision Strategy shape:
- Right-click the green plus sign, and then click Strategy to add the shape to the data flow.
- Right-click the Decision Strategy shape, and then click Properties.
- In the Strategy field, enter the name of the strategy that you prepared for adaptive model training.
- In the Store data for field, select the time frame to define how long you want to keep the adaptive inputs and strategy results using delayed learning.
- Click Submit.
- Configure the Destination shape:
- Display the shape properties.
- In the Destination field, click Data set.
- In the Data set field, enter pxAdaptiveAnalytics.
- Click Submit.
- Save the data flow.
- Run the data flow to train multiple model instances:
- In the header of the data flow tab, click .
- In the Data Flow Test Run window, click
Activate to run the data flow.You can view the progress of the data flow on the progress bar. You can also run the data flow from the Data Flows landing page.
Previous topic Adaptive model methods Next topic Deleting adaptive models