Skip to main content

Extending the Credit Offers Decision Strategy with Credit Score

7 Tasks

40 mins

Pega Credit Risk Decisioning
Visible to: All users
Beginner
Pega Credit Risk Decisioning
English

Scenario

The Credit Offers decision strategy outputs three values when a customer applies for a cash loan: one for credit offers, one for credit risk score, and one for credit eligibility.

The business wants to extend the decision strategy to add more intelligence by using external Credit Bureau data, a risk-based pricing model, and a scorecard to set the credit score for a customer.

The Credit request contains third-party credit bureau data provided by Equifax. Explore the Credit request data structure and the pre-built EquifaxResponse strategy.

The following table provides the credentials you need to complete the challenge:

Role User name Password
Credit Risk Manager CreditRiskManager rules

Your assignment consists of the following tasks:

Task 1: Explore the simulated customer Data Set

Explore the SimulationSetDDS Data Set, which contains simulated customer and credit bureau data.

Task 2: Explore the EquifaxResponse sub-strategy

Use an external sub-strategy component to reference the pre-built EquifaxResponse strategy. Explore the components of the strategy.

Task 3: Create and configure a scorecard model

Create a Scorecard model component and configure the scorecard with the conditions and scores in the following tables:

Property expression:

@DateTimeDifference(@dateValue(.LastEmploymentStartDate),@today(),'M')

Condition

Score

<= 3

0

<= 12

22

<= 36

37

Otherwise

44

Property expression: .MaritalStatus

Value

Score

MARRIED

33

WIDOWED

29

DIVORCED

28

SINGLE

25

Otherwise

29

Property expression: .MonthsOnBook

Condition

Score

<= 3

0

<= 12

20

<= 36

40

Otherwise

50

Property expression: .EmploymentStatus

Value

Score

STUDENT

25

EMPLOYED

35

UNEMPLOYED

20

SELF-EMPLOYED

25

RETIRED

28

PART TIME

25

Otherwise

23

Property expression: .AccommodationType

Value

Score

OWN HOUSE

31

RENTED APARTMENT

25

RENTED ROOM

20

LIVING WITH PARENTS

20

OWN APARTMENT

29

Otherwise

10

Property expression: .HasInsurance

Value

Score

True

29

False

25

Otherwise

0

Property expression:

@DateTimeDifference(@dateValue(.DateOfBirth),@today(),'Y')

Condition

Score

<= 21

25

<= 25

38

<= 35

43

<= 55

46

<= 65

54

Otherwise

0

Map score ranges to segment results, as shown in the following table:

Result

Cutoff value

RED

150

YELLOW

220

GREEN

Otherwise

Task 3: Create a score segment with inputs from the scorecard model and Equifax data

Use a decision table to combine data from the scorecard and Equifax data, as shown in the following table:

 

Conditions

Actions

 

Score <=

CB Score <=

Return

Score Segment

if

150

400

1

RED

else if

220

400

2

RED

else if

300

400

3

YELLOW

else if

150

550

4

RED

else if

220

550

5

YELLOW

else if

300

550

6

GREEN

else if

150

999

7

YELLOW

else if

220

999

8

GREEN

else if

300

999

9

GREEN

otherwise

   

10

UNKNOWN

Task 4: Create a risk-based pricing model with inputs from the score segment

Use a decision table to create a risk-based pricing model, as shown in the following table:

Conditions

Customer Segment

Product

Return

Risk Base Price

if

RED

CustomerLoan

1

2.0

else if

YELLOW

CustomerLoan

2

1.5

else if

GREEN

CustomerLoan

3

0.0

else if

RED

StudentLoan

4

1.2

else if

YELLOW

StudentLoan

5

1.0

else if

GREEN

StudentLoan

6

0.0

otherwise

   

7

0.0

Task 5: Use inputs from risk-based pricing and Equifax data to make calculations

Use a Set Property component to set various properties and calculations required for the credit decision, as shown in the following table:

Target Source

.MaxPayment

.PTI * (Primary.TotalIncome - Primary.TotalExpenses - EquifaxResponse.CBTotalLiabilities)

.MaxPayment

@if(.MaxPayment<0,0,.MaxPayment)

.InterestRate

.BaseRate + .RBP

.EMR

@divide(.InterestRate,1200,7)

.OfferTerm

@if(.IsAlternativeOffer,.MaxTerm,Primary.RequestedTerm)

.OfferAmount

.MaxPayment*@divide(@StrategyUtils.pow(1+.EMR,.OfferTerm)-1,.EMR*@StrategyUtils.pow(1+.EMR,.OfferTerm),0)

.OfferAmount

@min(@min(.OfferAmount,.MaxAmount),Primary.RequestedAmount)

Task 6: Create a separate output flow for Credit Score

Configure the components in two flows, Credit Offers and Credit Score.

 

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 Explore the simulated customer Data Set

  1. On the landing page of the challenge instance, click Launch Pega Infinity™ to log in to the Decision Management portal.
  2. Log in as a Credit Risk Manager:
    1. In the User name field, enter CreditRiskManager.
    2. In the Password field, enter rules.
  3. In the My Worklist section, click Credit risk strategy to open the change request.
  4. In the Scope of changes section, click Credit Offers to open the decision strategy.
  5. In the navigation pane, click Predictions to open Prediction Studio.
  6. In the navigation pane of Prediction Studio, click Data > Data Sets.
  7. Click SimulationSetDDS to open the Data Set.
  8. In the upper-right corner, click Actions > Run to inspect the Data Set:
    1. In the Operation list, select the Browse by keys option.
    2. In the Key field, select CustomerID.
    3. In the Value field, enter Customer70, then click Run.
    4. In the Data Set Preview window, inspect the results.
    5. Expand the Result(1) page, and then expand the CREDIT_RESPONSE > CREDIT_LIABILITY hierarchy.
      Tip: Notice that the customer has three liabilities.
    6. Expand the CREDIT_SUMMARY > DATA_SET hierarchy, and then click the DATA_SET(1) page.
      Tip: Notice that the page contains the value of the property AT57S.
    7. Close the Data Set Preview and Run Data Set windows to return to Prediction Studio.
  1. In the lower-left corner, click Back to Decision Manager Portal.

2 Explore the EquifaxResponse sub-strategy

  1. In the Credit Offer decision strategy, right-click the strategy canvas, and then select Sub strategy > External to add a Sub strategy component to the canvas.
    The strategy canvas
  2. Right-click the Sub Strategy component, and then click Properties to configure the component.
  3. In the External strategy field, enter or select EquifaxResponse, and then click Submit.
  4. Right-click the EquifaxResponse component, and then click Open strategy.
  5. In the CREDIT_SUMMARY component, click More > Properties to view the embedded strategy properties.
    The CREDITSUMMARY component
  6. On the Inputs tab, note the Iterate over and access data fields.
    The Inputs tab
  7. Click Cancel to return to the strategy.
  8. In the CREDIT_RESPONSE component, click More > Properties to view the embedded strategy properties.
  9. On the Inputs tab, note the Iterate over and access data fields.
  10. Click the Results tab, and then confirm that the output is a single result for each of the two aggregates.
    The output for the two aggregates
  11. Click Cancel to return to the strategy.
  12. In the CREDIT_RESPONSE component, right-click the Total Liability Calcs Set Property component, and then click Properties.
  13. In the Source section, confirm that the expression excludes closed liabilities: @if(CreditLiability.IsClosedIndicator="N",@String.toDecimal(CreditLiability.MonthlyPaymentAmount),0).
     
    The source section
  14. Click Cancel to return to the strategy.
  15. Right-click the CBScore component, and then click Properties.
  16. Confirm that the properties are set to equal expressions that reference properties from other components, or, as for the CBScore property, directly reference a property in the Data Set.
    Set property properties
  17. Click Cancel to return to the strategy canvas.
  18. On the right, expand the Test run pane to test the Equifax strategy.
  19. Configure the test run:
    1. On the Single case tab, expand the Settings section.
    2. In the Settings section, select Data set.
    3. In the Data set field, enter or select SimulationSetDDS.
    4. In the Customer ID field, enter Customer70.
      The Test run pane
    5. Click Save & Run.
      Note: Observe the values of the AT57S, CB Score, CB Total Delinquency, and CB Total Liabilities properties for this customer.
  1. Close the Equifax Response strategy to return to the Credit Offers decision strategy.

3 Create and configure a scorecard model

  1. Right-click the canvas, and then click Decision analytics > Scorecard model.
  2. Right-click the new Scorecard model component, and then click Properties to configure the component:
    1. In the Scorecard model field, enter Credit Application, and then click the Open icon to configure the scorecard.
    2. In the Context section, confirm that the Apply to field auto-populates with Data-CreditRiskCustomer.
    3. In the upper-right corner, click Create and open to open the scorecard.
  3. In the Combiner function section, confirm that Sum is the active selection.
  4. In the Predictor expression field, click the Open icon to open the Expression builder.
    1. Enter @DateTimeDifference(@dateValue(.LastEmploymentStartDate),@today(),'M').
    2. Click Submit to close the Expression builder.
  5. Define the conditions and scores as shown in the following table:

    Condition

    Score

    3

    0

    12

    22

    36

    37

    Otherwise

    44

  1. Click the Add icon to add another predictor expression.
  2. In the Predictor expression field, enter or select .MaritalStatus, and then define the property values and scores as shown in the following table:

    Value

    Score

    MARRIED

    33

    WIDOWED

    29

    DIVORCED

    28

    SINGLE

    25

    Otherwise

    29

  1. Click the Add icon to add another predictor expression.
  2. In the Predictor expression field, enter or select .MonthsOnBook, and then define the conditions and scores as shown in the following table:

    Condition

    Score

    3

    0

    12

    20

    36

    40

    Otherwise

    50

  1. Click the Add icon to add another predictor expression.
  2. In the Predictor expression field, enter or select .EmploymentStatus, and then define the property values and scores as shown in the following table:

    Value

    Score

    STUDENT

    25

    EMPLOYED

    35

    UNEMPLOYED

    20

    SELF-EMPLOYED

    25

    RETIRED

    28

    PART TIME

    25

    Otherwise

    23

  1. Click the Add icon to add another predictor expression.
  2. In the Predictor expression field, enter or select .AccommodationType, and then define the property values and scores as shown in the following table:

    Value

    Score

    OWN HOUSE

    31

    RENTED APARTMENT

    25

    RENTED ROOM

    20

    LIVING WITH PARENTS

    20

    OWN APARTMENT

    29

    Otherwise

    10

  1. Click the Add icon to add another predictor expression.
  2. In the Predictor expression field, enter or select .HasInsurance, and then define the property values and scores as shown in the following table:

    Value

    Score

    True

    29

    False

    25

    Otherwise

    0

  1. Click the Add icon to add another predictor expression.
  2. In the Predictor expression field, click the Open icon to open the Expression builder.
    1. Enter @DateTimeDifference(@dateValue(.DateOfBirth),@today(),'Y') to calculate the customer's age.
    2. Click Submit to close the Expression builder.
  3. Define the conditions with the values as shown in the following table:

    Condition

    Score

    < 21

    25

    < 25

    38

    < 35

    43

    < 55

    46

    < 65

    54

    Otherwise

    25

  1. On the Results tab, click Refresh to update the Minimum score and Maximum score fields.
  2. In the first row, in the Result field, enter RED.
  3. In the Cutoff field, enter 150.
  4. Click the Add icon and define the remaining conditions as shown in the following table:

    Result

    Cutoff value

    RED

    150

    YELLOW

    220

    GREEN

    Otherwise

  1. Click Save, and then close the scorecard model.
  2. On the Score mapping tab, select the Enable score mapping checkbox.
  3. In the text field, enter or select .Score to map the scorecard output.
  4. On the Scorecard tab, re-select the Credit Application scorecard model, and then click Submit to save the Scorecard model component configuration.
    The Scorecard model component configuration
    Tip: Test with different customers. Can you explain the property values that the scorecard model sets?

4 Create a score segment with inputs from the scorecard model and Equifax data

  1. On the canvas, right-click, and then click Business Rules > Decision Table to add the component to the canvas.
  2. Place the new component to the right of the Scorecard model component, as shown in the following figure:
    The strategy canvas with the Decision Table component
  3. Hover over the Scorecard model component, and then click and drag the grey arrow to connect it to the Decision Table component.
  4. Right-click the Decision Table component, and then select Properties to configure the decision table properties:
    1. In the Defined on section, select Strategy result, and then confirm that the CDHOrg-CreditRisk-SR-Origination class is the active selection.
    2. In the Decision table field, enter Multi Score Segment, and then click the Open icon to create the decision table.
  5. On the Create Decision Table landing page, ensure that the Apply to class is CDHOrg-CreditRisk-SR-Origination.
  6. Click Create and open.
  7. On the Parameters tab, configure a parameter:
    1. In the Name field, enter CBScore.
    2. In the Description field, enter Credit Bureau Score.
    3. In the Data type list, select Integer.
      CBscore parameter configuration
  8. On the Results tab, expand the Preset Properties section to preset the issue and group properties:
    1. Set .pyIssue to "Origination".
    2. Set .pyGroup to "Scoring Segment".
  9. On the Table tab, click the first empty cell next to the if row in the Conditions column to edit the decision table.
  10. In the toolbar, click Insert column After to add a column.
    Insert column After icon
  11. In the Conditions column, click the first cell to select the first property:
    The first cell of the conditions column
    1. In the Property field, enter or select .Score.
    2. In the Label field, enter Score.
    3. From the Use Operator list, select <=.
    4. Click Save to return to the Table tab.
  12. In the column next to the Score <= column, click the first cell, and then enter the following information:
    1. In the Property field, enter Param.CBScore.
    2. In the Label field, enter CB Score.
    3. Select <= from the Use Operator list.
    4. Click Save to return to the Table tab.
  13. Click the Set Property Values icon to add a new column to the right of the Return column.
    Set Property Values Iconicon
  14. In the new column, click the first cell, and then enter the following information:
    1. In the Property field, enter .ScoreSegment.
    2. In the Label field, enter Score Segment.
    3. Click Save to return to the Table tab.
  15. In the if row, enter the following values:
    1. In the Score <= column, enter 150.
    2. In the CB Score column, enter 400.
    3. In the Return column, enter 1.
    4. In the Score Segment column, enter RED.
  16. Click the Insert Row After icon to add an else if row:
    the Insert Row After icon
  17. Enter the following values in the else if row:
    1. In the Score <= column, enter 220.
    2. In the CB Score column, enter 400.
    3. In the Return column, enter 2.
    4. In the Score Segment column, enter RED.
  18. Repeat step 16, and then enter the following conditions and return values to complete the table:
     

    Conditions

    Actions

     

    Score <=

    CB Score <=

    Return

    Score Segment

    if

    150

    400

    1

    RED

    else if

    220

    400

    2

    RED

    else if

    300

    400

    3

    YELLOW

    else if

    150

    550

    4

    RED

    else if

    220

    550

    5

    YELLOW

    else if

    300

    550

    6

    GREEN

    else if

    150

    999

    7

    YELLOW

    else if

    220

    999

    8

    GREEN

    else if

    300

    999

    9

    GREEN

    otherwise

       

    10

    UNKNOWN

  1. Click Save, and then close the decision table to return to the Credit Offers decision strategy.
  2. In the Decision table properties dialog box, reselect the Multi Score Segment decision table, expand the Supply data via section, and then set the CBScore parameter to EquifaxResponse.CBScore.
    Multi Score Segment properties
  3. Click Submit to save the decision table configuration.
    The next decision table configuration
    Note: Notice the dotted line between the Multi Score Segment decision table and the Equifax Response sub-strategy. This line indicates a data reference between the two components.
  1. Open the Test run pane to test the Multi Score Segment decision table:
    1. In the Settings section, select Data set.
    2. In the Data set field, enter or select SimulationSetDDS.
    3. In the Customer ID field, enter or select Customer70.
    4. Click Save &Run.
    5. Click the Multi Score Segment decision table component.
    6. In the Test run pane, notice the Business Issue, Group, Segment, Score, and Score Segment properties.
      Tip: Test with different customers. Can you explain the property values that the decision table sets?

5 Create a risk-based pricing model with inputs from the score segment

  1. Right-click the canvas, and then select Business Rules > Decision Table to add the component.
  2. Right-click the component, and then select Properties to configure the decision table.
  3. In the Name field, enter Calculate Risk-Based Pricing.
  4. In the Defined on section, select Strategy result, and then confirm that the CDHOrg-CreditRisk-SR-Origination class is the active selection.
  5. In the Decision table field, enter Calculate Risk-Based Pricing, and then click the Target icon to create the decision table.
  6. On the Create Decision Table landing page, ensure that the Apply to class is CDHOrg-CreditRisk-SR-Origination.
  7. Click Create and open.
  8. Create a table that consists of four columns, as shown in the following picture:
    a table that consists of four columns
  9. On the Parameters tab, enter the following parameter details:
    1. In the Name field, enter CustomerSegment.
    2. In the Description field, enter Customer Segment.
    3. In the Data type field, select Text.
  10. On the Table tab, in the first column, click the first cell to configure the property, and then enter the following details:
    1. In the Property field, enter Param.CustomerSegment.
    2. In the Label field, enter Customer Segment.
    3. In the Use Operator field, enter =.
  11. In the second column, click the first cell to configure the property, and then enter the following details:
    1. In the Property field, enter .pyName.
    2. In the Label field, enter Product.
    3. In the Use Operator field, enter =.
  12. In the Property Values column, to the right of the Return column, click the first cell, and then enter the following details:
    1. In the Property, enter .RBP.
    2. In the Label, enter Risk Base Price.
    3. In the Use Operator, enter =.
  13. Complete the table as shown in the following table:

    Conditions

    Customer Segment

    Product

    Return

    Risk Base Price

    if

    RED

    CustomerLoan

    1

    2.0

    else if

    YELLOW

    CustomerLoan

    2

    1.5

    else if

    GREEN

    CustomerLoan

    3

    0.0

    else if

    RED

    StudentLoan

    4

    1.2

    else if

    YELLOW

    StudentLoan

    5

    1.0

    else if

    GREEN

    StudentLoan

    6

    0.0

    otherwise

       

    7

    0.0

  1. Click Save, and then close the decision table.
  2. In the Decision Table Properties dialog box, re-select CalculateRiskBasedPricing.
  3. Expand the Supply data via section, and then set the CustomerSegment parameter to MultiScoreSegment.ScoreSegment.
  4. Click Submit.
    Note: Notice the dotted line between the Multi Score Segment decision table and the Calculate Risk Based Pricing decision table. This line indicates a data reference between the two components. The MultiScoreSegment.ScoreSegment parameter makes this reference.
  1. On the Credit Offers decision strategy canvas, connect the Only allowed products filter to the Calculate Risk Base Pricing decision table.
  2. Connect the Calculate Risk Base Pricing decision table to the Prioritized Credit Offers component.
  3. Delete the connection between the Filter and Prioritize components.
  4. Rearrange your strategy to resemble the following figure:
    The canvas for the Credit offers decision strategy
  5. Open the Test run pane to test the Credit Offers decision strategy:
    1. In the Settings section, select Data set.
    2. In the Data set field, enter or select SimulationSetDDS.
    3. In the Customer ID field, enter or select Customer70.
    4. Click Save & Run.
    5. Click the Calculate Risk Based Pricing component.
    6. Notice the RBP property in the Test run pane.
      Tip: Test with different customers. Can you explain the property values that the decision table sets?

6 Use inputs from risk-based pricing and Equifax data to make calculations

  1. Right-click the canvas, and then click Enrichment > Set Property to add the component to the canvas.
  2. Right-click the new component, and then click Properties.
  3. In the Name field, enter Offer Calculations, and then click Submit.
  4. Delete the connection between Calculate Risk-Based Pricing and Prioritized Credit Offers components.
  5. Connect the Calculate Risk-Based Pricing to the Offer Calculations component.
  6. Connect Offer Calculations to the Prioritized Credit Offers component.
  7. Rearrange your strategy to resemble the following figure:
    The strategy canvas and the new offer calculations component
  8. Right-click the new Set Property component, and then click Properties to configure the component:
    1. In the Define action, target, and source section, click Add item to add a new target property and its source.
    2. In the Target field, enter .MaxPayment.
    3. In the Source field, enter .PTI * (Primary.TotalIncome - Primary.TotalExpenses - EquifaxResponse.CBTotalLiabilities).
    4. Repeat steps 7a-c to complete the configuration as shown in the following table:
      Target Source

      .MaxPayment

      .PTI * (Primary.TotalIncome - Primary.TotalExpenses - EquifaxResponse.CBTotalLiabilities)

      .MaxPayment

      @if(.MaxPayment<0,0,.MaxPayment)

      .InterestRate

      .BaseRate + .RBP

      .EMR

      @divide(.InterestRate,1200,7)

      .OfferTerm

      @if(.IsAlternativeOffer,.MaxTerm,Primary.RequestedTerm)

      .OfferAmount

      .MaxPayment*@divide(@StrategyUtils.pow(1+.EMR,.OfferTerm)-1,.EMR*@StrategyUtils.pow(1+.EMR,.OfferTerm),0)

      .OfferAmount

      @min(@min(.OfferAmount,.MaxAmount),Primary.RequestedAmount)

    5. Click Submit.
      Note: Notice the dotted line between the Equifax Response sub-strategy and the Offer Calculations component. This line indicates a data reference between the two components.
  1. Delete the connection between the Offer Calculations and Prioritized Credit Offers components.
  2. Right-click the canvas, and then click Arbitration > Filter to add a Filter component to the canvas.
  3. Connect the Offer Calculations component to the Filter component.
  4. Connect the Filter component to the Prioritize Offers component.
  5. Rearrange your strategy to resemble the following figure:
    The rearranged canvas
  6. Right-click the new Filter component, and then select Properties to configure the component:
    1. In the Name field, enter Valid Product Offers.
    2. In the Filter condition, enter .OfferAmount >= .MinAmount.
    3. Click Submit.
  7. Expand the Test run pane to test the Credit Offers decision strategy:
    1. In the Settings section, select Data set.
    2. In the Data set field, enter or select SimulationSetDDS.
    3. In the Customer ID field, enter or select Customer70.
    4. Click Save & Run.
    5. In the Show component level values for list, select Number of decisions.
    6. Note the number of decisions for each component and observe if they change.
      Tip: Test with different customers. Can you explain why customers have three decisions in the Set Offer Properties component but have fewer decisions in the Results component?

7 Create a separate output flow for Credit Score

  1. Right-click the canvas, and then click Enrichment > Set Property to add the component to the canvas.
  2. Position the new component between the MultiScoreSegment and Results components.
  3. Connect the Score Segment to the new Set Property component.
  4. Connect the new Set Property component to the Results component.
  5. Right-click the Set property component, and then click Properties to configure the component.
    1. In the Name field, enter Credit Score.
    2. In the Define action, target, and source section, click Add item to add a new target property and its source.
    3. In the Target field, enter or select .pyName.
    4. In the Source field, enter or select .ScoreSegment.
    5. Click Submit to save the configuration.
  6. Your strategy should resemble the below figure:
    Credit offers decision strategy
  7. Open the Test run panel to test the Credit Offers decision strategy:
    1. In the Settings section, select Data set.
    2. In the Data set field, enter or select SimulationSetDDS.
    3. In the Customer ID field, enter or select Customer70.
    4. Click Save & Run.
    5. Click on the Credit Score component.
      Note: Notice the Name property in the Test run pane.
    6. Click the Results component.
    7. In the Test Run pane, in the Results in Credit Offers section, click the arrow to cycle through the pages.
      Results in Credit Offers
      Tip: Try to identify items from each of the two flows in the strategy.

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