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.6 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 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 little bias to comply with their business regulations and requirements.

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

Role

User name

Password

Decisioning Analyst

CDHAnalyst

rules

Your assignment consists of the following tasks:

Task 1: Prepare data set for simulation run

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

Note: The Sampled Customers is not available in a persisted store. To initialize the customer data, first, run the PrepareSampledCustomers_REF data flow.
If you already initiated the customer data as part of the previous challenge, you need not perform Task 1.

Task 2: Create an ethical bias policy

Create an ethical bias policy to include the .Customer.Age and .Customer.Gender properties with 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 simulation run

  1. Log in as Decisioning Analyst with user name CDHAnalyst and password rules.
  2. In the navigation pane of Pega Customer Decision Hub, click Data > Data Flows.
    Data flows
  3. Search for and then open the PrepareSampledCustomers_REF data flow to prepare the data set used for simulations. This data is based on a Monte Carlo dataset, which is generated.
    Note: The Monte Carlo data set generates a mock data set. As a result, different simulation runs have different results.
  1. Click Actions > Run.
    Run a data flow
  2. Click Submit.
  3. Click Start.
    Note: Notice that the prospect data is populated once the test run is complete.
  1. Close the data flow Test run window.

2 Create an ethical bias policy

  1. In the header of the Pega Customer Decision Hub portal, click the Configuration icon, and then select Ethical Bias Policy.
    Ethical Bias policy
  2. 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 Sales section, click Customer.Age.
    Sales bias threshold
  12. In the Customer.Age window, select 0 Gini (No shift).
    Gini
  13. In the Sales section, click Customer.Gender.
    Sales gender threshold
  14. In the Customer.Gender window, select 1 Rate ratio (No shift)
    Rate ratio
  15. Click Save.

3 Create an ethical bias simulation run

  1. In the navigation pane of the Pega Customer Decision Hub portal, click Simulation Testing.
    Simulation testing
  2. In the upper-right corner, click Create > Ethical bias.
    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 CreditCards (NBA_Sales_Creaditcards) strategy, click Add.
    Select a 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 SampledCustomers audience click Add.
    Select audience
  8. Click Apply.
  9. Click the Edit icon to update the Simulation name field.
    Edit 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 reports
  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.
  2. Note that bias is identified.
    bias identified
  3. Click Bias report to learn which property has the bias identified and for which action.
    open bias report
     
  4. In the Bias report, sort the report on the Bias detected field to list the actions with bias on the top.
    Sort bias report
    Note: The bias is detected on Age.
    bias report
  5. Close the report.

5 Check the engagement policy conditions

  1. In the navigation pane of Pega Customer Decision Hub, click Next-Best-Action > Designer.
    NBA designer
  2. Click Engagement policy.
    Engagement policy
  3. Click Creditcards.
    Credit cards group
  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 the 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 Sales section, click Customer.Age.
  3. In the Customer.Age window, select 0.1 Gini.
    Gini value
  4. Click Save.

7 Re-run the ethical bias simulation run

  1. In the left navigation pane of Pega Customer Decision Hub, click Simulation Testing.
  2. Click on EthicalBias_NBASales S-##### to open the ethical bias run.
  3. Click Action > Restart simulation to re-run the ethical bias simulation.
    restart simulation
     
  4. Submit to confirm.
  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_Sales_Creditcards strategy level. Once the simulation is executed, analyze why a bias is detected on Gender and how you can avoid that.


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