Skip to main content

Detecting unwanted bias in engagement policy conditions

7 Tasks

15 mins

Visible to: All users
Beginner Pega Customer Decision Hub 8.7 English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

U+ Bank is currently cross-selling on the web by showing various credit cards to its customers.

The bank wants to run an ethical bias simulation in Pega Customer Decision Hub™ and identify any unwanted bias in the engagement policy conditions. If any bias is detected, the bank would like to adjust the bias threshold to allow slight bias to comply with their business regulations and requirements.

Use the following credentials to log in to the exercise system:

Role User name Password
Next-Best-Action Designer NBADesigner rules

Your assignment consists of the following tasks:

Task 1: Prepare data set for simulation run

Run the PrepareSimulationData data flow to prepare the data set for the simulation run.

Note: The SampledCustomers_Inbound is not available in a persisted store. To initialize the customer data, first, run the PrepareSimulationData data flow.
If you already run the PrepareSimulationData in this exercise system as part of a previous challenge, you do not need perform this task.

Task 2: Create an ethical bias policy

Create an ethical bias policy to include the .Customer.Age and .Customer.Gender properties with the Data-Decision-Request-Customer class as the context.

Task 3: Create an ethical bias simulation run

Create an ethical bias simulation run to check unwanted bias in the engagement policy conditions.

Task 4: Examine the simulation results

Examine the simulation results to identify on which property bias was detected.

Task 5: Check engagement policy conditions

Check the engagement policy conditions to know which condition is causing the bias.

Task 6: Modify the ethical bias policy

Modify the ethical bias policy to increase the threshold of the Age property.

Task 7: Re-run the ethical bias simulation run

Re-run the ethical bias simulation to verify the changes made to the ethical bias policy.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Prepare data set for the simulation run

  1. On the exercise system landing page, click Pega CRM suite to log in to Customer Decision Hub.
  2. Log in as Next-Best-Action Designer with User name NBADesigner and Password rules.
  3. In the navigation pane of Customer Decision Hub, click Data > Data Flows to view the list of data flows.
    Data flows
  4. Search for and then open the PrepareSimulationData data flow to prepare the data set used for simulations. This data is based on a Monte Carlo dataset, which is generated by the system.
    Note: The Monte Carlo data set generates a mock data set. As a result, different simulation runs have different results.
  1. Click Actions > Run to initialize the customer data.
    Run a data flow
  2. Click Submit.
  3. Click Start to process the data, and then wait for the processing to complete.
    Note: Notice that the prospect data is populated once the test run is complete.
  1. Close the data flow window.

2 Create an ethical bias policy

  1. In the header of Customer Decision Hub, click the Configuration icon, and then select Ethical Bias Policy to configure an ethical bias policy.
    Ethical Bias Policy
  2. In the Bias fields section, in the Context field, enter or select Data-Decision-Request-Customer.
    Ethical bias context
  3. Click Add bias field to include the properties that you want to test.
    Add bias field
  4. In the Add bias field window, in the Field field, enter or select .Customer.Age.
    Add Age bias field
  5. Click Next.
  6. Leave the Do the numbers represent categories? set to No.
  7. Click Add bias field.
  8. In the Add bias field window, in the Field field, enter or select .Customer.Gender.
    Add Gender as a bias field
  9. Click Add bias field.
  10. Click the Bias threshold tab.
    Bias threshold
  11. In the Grow section, click Customer.Age.
    Grow bias threshold
  12. In the Customer.Age window, select 0 Gini (No shift).
    Gini
  13. In the Grow section, click Customer.Gender.
    Grow gender threshold
  14. In the Customer.Gender window, select 1 Rate ratio (No shift)
    Rate ratio
  15. Click Save to save the ethical bias policy.

3 Create an ethical bias simulation run

  1. In the navigation pane of the Customer Decision Hub, click Simulation Testing to access the simulation tests.
    Simulation testing
  2. In the upper-right corner, click Create > Ethical bias to configure the simulation run of the ethical bias policy.
    Create Ethical Bias
  3. In the Configure inputs section, next to Strategy, click Configure to select a strategy on which you want to run the simulation.
    Configure strategy
  4. In the Strategy dialog box, to the right of the NBA_Grow_Creditcards strategy, click Add.
    Strategy
  5. Click Apply to add the strategy.
  6. In the Configure inputs section, next to Audience, click Configure to select an audience on which you want to run the simulation.
    Configure audience
  7. In the Audience dialog box, to the right of the SampledCustomers_Inbound audience, click Add.
    Select audience
  8. Click Apply to add the audience.
  9. Click the Edit icon to update the Simulation name field.
    Edit the simulation name
  10. In the Simulation name field, enter EthicalBias_NBASales.
  11. Click Done.
    Rename simulation
    Note: The simulation results are output to the Insights data set.
    Output destination

    Note that the simulation has two bias reports automatically available as output.

    Bias report
  12. In the upper right, click Submit and Run to run the simulation.

4 Examine the simulation results

  1. Once the simulation run is complete, click Review reports.
    Note that bias is identified.
    Bias identified
  2. Click Bias report to learn which property has the bias identified and for which action.
    Open bias report
  3. In the Bias report, click the Bias detected column, and then click Sort > Highest to lowest to sort the report by listing the actions with bias on the top.
    Sort bias report
    Note: The bias is detected on Age.
    Bias report
  1. Close the report.

5 Check the engagement policy conditions

  1. In the navigation pane of Customer Decision Hub, click Next-Best-Action > Designer to open Next-Best-Action Designer.
    NBA designer
  2. Click Engagement policy.
    Engagement policy
  3. In the Business structure section, click Credit cards.
    Business structure
  4. Verify that Age is defined as an eligibility condition.
    Eligibility conditions
    Note: As Age is used as an eligibility condition, which cannot be ignored, the bias threshold for the property needs to be adjusted to allow little bias.
  1. Close Next-Best-Action Designer.

6 Modify the ethical bias policy

  1. In the upper right, click the Configuration icon, and then select Ethical Bias Policy.
  2. In the Grow section, click Customer.Age.
  3. In the Customer.Age window, select 0.1 Gini.
    Gini value
  4. Click Save to save the ethical bias policy.

7 Re-run the ethical bias simulation run

  1. In the navigation pane of Customer Decision Hub, click Simulation Testing to access the simulation tests.
  2. Click S-##### to open the ethical bias run.
  3. Click Action > Restart simulation to re-run the ethical bias simulation.
    Restart simulation
  4. Click Submit to confirm the simulation run.
  5. Once the run is complete, click Review reports.
    Note that there is no bias detected now.
    No bias detected
  6. Open the Bias report.
  7. Verify that the Bias detected field is false for all the actions.
    Bias report results
    Note: As an additional task, you can run an ethical bias simulation at the Trigger_NBA_Grow_Creditcards strategy level.
    Once the simulation completes its run, analyze why a bias is detected on Age and how you can avoid that.

This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice