This content has been archived and is no longer being maintained.

Table of Contents

Article

Training adaptive models in bulk with data flows

You can efficiently train adaptive models in bulk by using a specialized data flow with a dedicated decisioning strategy. This method is less time consuming than manually uploading historical data to train adaptive models in complex strategies that can contain hundreds of propositions.

Adaptive models are Pega 7 Platform scoring models that can capture and analyze customer responses in real time. Adaptive models identify the most suitable proposition for a customer or determine the proposition that the customer is most likely to accept. Adaptive models are created as a result of running a decisioning strategy that contains an Adaptive Model component (strategy shape) and are displayed on the Adaptive Models Management landing page. For each proposition referenced in the strategy, the system creates one adaptive model.

Adaptive models do not require historical or sample data. However, you can update individual models by using the Upload Responses wizard. With the wizard, you can train your adaptive models with historical or sample customer responses and improve the initial performance of the model. The use of previous results enables the Adaptive Decision Manager (ADM) server to create models that can predict behavior more accurately.

Use case for training adaptive models in bulk

A company that serves a large number of 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 CustomerResponse database column contains historical responses for a strategy in which each customer is presented with a group of propositions and can choose only one (Insurance1, Insurance2, or Insurance3). When a customer accepts a proposition, the other two are automatically rejected.

Customer database example
Sample database fragment with customer information and recorded response

Now, the company needs a solution that takes the customer interaction data, feeds it 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.

Training adaptive models in bulk

To support training adaptive models in bulk, you must create and set up two rules. The first rule is your decisioning 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 specialized data flow. The purpose of this data flow is to upload historical or sample data into the adaptive model data set. As a result, multiple adaptive models are trained simultaneously without the need to run the Upload Responses wizard for each model.

This tutorial takes approximately 60 minutes to complete.
  1. Prerequisites
  2. Creating a strategy for training adaptive models in bulk
  3. Creating a data flow for training adaptive models in bulk

Prerequisites

Verify that your historical customer response data is stored in a dedicated data set. The Pega 7 Platform data sets do not support CSV or other text file formats. As a best practice, source your data from a database table or a storage stream.

Creating a strategy for training adaptive models in bulk

First, you must create a strategy that references multiple propositions for training adaptive models in bulk. This strategy must import proposition data and feed it to an adaptive model that trains with each received response. For each proposition in the strategy, the system creates an adaptive model on the Adaptive Model Management landing page. For example, if your decisioning strategy references 50 propositions, the system creates 50 adaptive models.

  1. In Designer Studio, click Decisioning > + Create > Strategy to create the Strategy rule that you want to use for training adaptive models in bulk.
  2. 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.
  3. If the channel dimension or subject ID information for the strategy are not already configured, specify the channel dimension and subject ID settings:
    1. On the strategy canvas, right-click and click Enrichment > Set Property to add a Set Property shape.
    2. Right-click the Set Property shape and click Properties.
    3. Set the .pyDirection property to the direction that you use in the interaction with the customer.
    4. Set the .pyChannel property to the channel that you use in the interaction with the customer.
      The configuration of the channel dimension settings ensures that the correct adaptive models are trained.
    5. Set the .pySubjectID property. Set this property only if the .pySubjectID is not already the class key of the Applies-To class of the strategy.
      In a typical decisioning strategy, the key of the Applies-To class is set to either Customer or Subject ID and is used as the .pySubjectID property in the strategy results. In a bulk response upload scenario like this one, the data model might not contain a Subject ID, or the Applies-To class might not have the Subject ID set. In this case, verify that the .pySubjectID property is set to a non-empty value.
      Channel Dimension Settings
      Channel dimension and Subject ID settings
  4. Configure an Adaptive Model strategy shape.
    1. On the strategy canvas, right-click and click Decision Analytics > Adaptive Model, to add an Adaptive Model shape.
    2. Right-click the Adaptive Model shape and click Properties.
    3. 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.
    4. 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).
      Outcome configuration
      Adaptive Model rule Outcomes tab
  5. Configure the strategy so that it updates adaptive models with historical or sample responses:
    1. On the strategy canvas, right-click and click Enrichment > Set Property to add a Set Property shape. Place it after the Adaptive Model shape.
    2. Right-click the Set Property shape and click Properties.
    3. In the Define action, target, and source section, click Add Item.
    4. Set the adaptive model outcome property based on the database column that contains historical or sample customer response:
      • Action - Specify the action as Set
      • Target - Enter the target as .pyOutcome
      • Source - Set the adaptive model outcome based on the database field that contains historical or sample customer response, for example, @if(.pyName == Primary.CustomerResponse, "Accept", "Reject"). 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.
        When you introduce more complex expressions such as @if(<logic>,<"conditionSucceeds">,<"conditionFails">), you can have multiple adaptive models learn from responses to their corresponding propositions and from responses to other propositions. You can develop a powerful pattern in which adaptive models learn more effectively and are more accurate.
        With complex expressions, you can train adaptive models in scenarios where your database contains multiple fields where customer responses are captured. Consider the following expression: @if( @contains(Primary.RESPONSE_POSITIVE, .pyName) , "Accept", @if ( @contains(Primary.RESPONSE_NEGATIVE, .pyName),"Decline", "None").In this example, the RESPONSE_POSITIVE database field contains positive customer responses and the RESPONSE_NEGATIVE database field contains negative customer responses.
    5. Click Submit.
      Adaptive model outcome
      Adaptive model outcome configuration
  6. Connect the strategy shapes.
  7. Save the strategy.
  8. Run the strategy. From Designer Studio, click Actions > Run. The Adaptive Models Management landing page is populated with adaptive models. The number of adaptive models created is equal to the number of propositions referenced in the strategy. The initial performance value is 50% for each adaptive model.
    Response Strategy
    Sample strategy dedicated for training adaptive models in bulk

Creating a data flow for training adaptive models in bulk

After you create your decisioning strategy, you must create a data flow that uploads your historical or sample data to each adaptive model that was created on the Adaptive 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 decisioning strategy that trains the adaptive models that you want to improve. The destination of the data flow is always the ADM server (pxAdaptiveAnalytics). If the class of the data set and the decisioning strategy referenced in this data flow do not match, you must convert the properties from the data set class to the strategy class.

Data Flow
Data flow for training adaptive models in bulk

  1. In Designer Studio, click Data Model > + Create > Data Flow to create a data flow rule.
  2. To configure the Source shape, right-click the shape and click Properties:
    1. Reference the data set with historical or sample outcomes that you want to use to train your adaptive models.
    2. Use the Preview option to preview the data set and test the connection.
    3. Click Submit.
  3. Optional: Configure a Convert shape, if the data set with historical or sample data and the referenced strategy are configured in different classes.
    1. Right-click the green plus sign and click Convert to add the shape to the data flow.
    2. Right-click the Convert shape and click Properties.
    3. In the Convert to field, enter the name of the class where the strategy for adaptive model training is located.
    4. Configure the property mapping to propagate properties from the source to the target class.
    5. Click Submit.
      Convert Properties
      Convert shape properties
  4. Configure a Decision Strategy shape:
    1. Right-click the green plus sign and click Decision Strategy to add the shape to the data flow.
    2. Right-click the Decision Strategy shape and click Properties.
    3. In the Strategy field, enter the name of the strategy that you prepared for adaptive model training.
    4. Select Manage learning cycle or outcome capture.
    5. Select and configure the Store adaptive inputs and strategy for field.
    6. Click Submit.
      Decision properties
      Decision Strategy shape properties
  5. Configure the Destination shape:
    1. Display the shape properties.
    2. In the Destination field, click Data set.
    3. In the Data set field, enter pxAdaptiveAnalytics.
    4. Click Submit.
      Destination Properties dialog box
      Destination shape properties
  6. Save the data flow.
  7. Run the data flow to train multiple adaptive models:
    1. In Designer Studio, click Actions > Run. The Data Flow Test Run window opens.
    2. 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.

After you complete this tutorial, you can view the increased performance of adaptive models on the Adaptive Models Management landing page.

Published February 25, 2016 — Updated September 4, 2018


100% found this useful

Related Content

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.