Extending the Credit Offers Decision Strategy with Credit Score
7 Tasks
40 mins
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.
Challenge Walkthrough
Detailed Tasks
1 Explore the simulated customer Data Set
- On the landing page of the challenge instance, click Launch Pega Infinity™ to log in to the Decision Management portal.
- Log in as a Credit Risk Manager:
- In the User name field, enter CreditRiskManager.
- In the Password field, enter rules.
- In the My Worklist section, click Credit risk strategy to open the change request.
- In the Scope of changes section, click Credit Offers to open the decision strategy.
- In the navigation pane, click Predictions to open Prediction Studio.
- In the navigation pane of Prediction Studio, click Data > Data Sets.
- Click SimulationSetDDS to open the Data Set.
- In the upper-right corner, click Actions > Run to inspect the Data Set:
- In the Operation list, select the Browse by keys option.
- In the Key field, select CustomerID.
- In the Value field, enter Customer70, then click Run.
- In the Data Set Preview window, inspect the results.
- Expand the Result(1) page, and then expand the CREDIT_RESPONSE > CREDIT_LIABILITY hierarchy.
Tip: Notice that the customer has three liabilities.
- 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.
- Close the Data Set Preview and Run Data Set windows to return to Prediction Studio.
- In the lower-left corner, click Back to Decision Manager Portal.
2 Explore the EquifaxResponse sub-strategy
- 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.
- Right-click the Sub Strategy component, and then click Properties to configure the component.
- In the External strategy field, enter or select EquifaxResponse, and then click Submit.
- Right-click the EquifaxResponse component, and then click Open strategy.
- In the CREDIT_SUMMARY component, click More > Properties to view the embedded strategy properties.
- On the Inputs tab, note the Iterate over and access data fields.
- Click Cancel to return to the strategy.
- In the CREDIT_RESPONSE component, click More > Properties to view the embedded strategy properties.
- On the Inputs tab, note the Iterate over and access data fields.
- Click the Results tab, and then confirm that the output is a single result for each of the two aggregates.
- Click Cancel to return to the strategy.
- In the CREDIT_RESPONSE component, right-click the Total Liability Calcs Set Property component, and then click Properties.
- In the Source section, confirm that the expression excludes closed liabilities: @if(CreditLiability.IsClosedIndicator="N",@String.toDecimal(CreditLiability.MonthlyPaymentAmount),0).
- Click Cancel to return to the strategy.
- Right-click the CBScore component, and then click Properties.
- 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.
- Click Cancel to return to the strategy canvas.
- On the right, expand the Test run pane to test the Equifax strategy.
- Configure the test run:
- On the Single case tab, expand the Settings section.
- In the Settings section, select Data set.
- In the Data set field, enter or select SimulationSetDDS.
- In the Customer ID field, enter Customer70.
- Click Save & Run.
Note: Observe the values of the AT57S, CB Score, CB Total Delinquency, and CB Total Liabilities properties for this customer.
- Close the Equifax Response strategy to return to the Credit Offers decision strategy.
3 Create and configure a scorecard model
- Right-click the canvas, and then click Decision analytics > Scorecard model.
- Right-click the new Scorecard model component, and then click Properties to configure the component:
- In the Scorecard model field, enter Credit Application, and then click the Open icon to configure the scorecard.
- In the Context section, confirm that the Apply to field auto-populates with Data-CreditRiskCustomer.
- In the upper-right corner, click Create and open to open the scorecard.
- In the Combiner function section, confirm that Sum is the active selection.
- In the Predictor expression field, click the Open icon to open the Expression builder.
- Enter @DateTimeDifference(@dateValue(.LastEmploymentStartDate),@today(),'M').
- Click Submit to close the Expression builder.
- Define the conditions and scores as shown in the following table:
Condition
Score
3
0
12
22
36
37
Otherwise
44
- Click the Add icon to add another predictor expression.
- 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
- Click the Add icon to add another predictor expression.
- 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
- Click the Add icon to add another predictor expression.
- 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
- Click the Add icon to add another predictor expression.
- 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
- Click the Add icon to add another predictor expression.
- 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
- Click the Add icon to add another predictor expression.
- In the Predictor expression field, click the Open icon to open the Expression builder.
- Enter @DateTimeDifference(@dateValue(.DateOfBirth),@today(),'Y') to calculate the customer's age.
- Click Submit to close the Expression builder.
- 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
- On the Results tab, click Refresh to update the Minimum score and Maximum score fields.
- In the first row, in the Result field, enter RED.
- In the Cutoff field, enter 150.
- Click the Add icon and define the remaining conditions as shown in the following table:
Result
Cutoff value
RED
150
YELLOW
220
GREEN
Otherwise
- Click Save, and then close the scorecard model.
- On the Score mapping tab, select the Enable score mapping checkbox.
- In the text field, enter or select .Score to map the scorecard output.
- On the Scorecard tab, re-select the Credit Application scorecard model, and then click Submit to save 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
- On the canvas, right-click, and then click Business Rules > Decision Table to add the component to the canvas.
- Place the new component to the right of the Scorecard model component, as shown in the following figure:
- Hover over the Scorecard model component, and then click and drag the grey arrow to connect it to the Decision Table component.
- Right-click the Decision Table component, and then select Properties to configure the decision table properties:
- In the Defined on section, select Strategy result, and then confirm that the CDHOrg-CreditRisk-SR-Origination class is the active selection.
- In the Decision table field, enter Multi Score Segment, and then click the Open icon to create the decision table.
- On the Create Decision Table landing page, ensure that the Apply to class is CDHOrg-CreditRisk-SR-Origination.
- Click Create and open.
- On the Parameters tab, configure a parameter:
- In the Name field, enter CBScore.
- In the Description field, enter Credit Bureau Score.
- In the Data type list, select Integer.
- On the Results tab, expand the Preset Properties section to preset the issue and group properties:
- Set .pyIssue to "Origination".
- Set .pyGroup to "Scoring Segment".
- On the Table tab, click the first empty cell next to the if row in the Conditions column to edit the decision table.
- In the toolbar, click Insert column After to add a column.
- In the Conditions column, click the first cell to select the first property:
- In the Property field, enter or select .Score.
- In the Label field, enter Score.
- From the Use Operator list, select <=.
- Click Save to return to the Table tab.
- In the column next to the Score <= column, click the first cell, and then enter the following information:
- In the Property field, enter Param.CBScore.
- In the Label field, enter CB Score.
- Select <= from the Use Operator list.
- Click Save to return to the Table tab.
- Click the Set Property Values icon to add a new column to the right of the Return column.
- In the new column, click the first cell, and then enter the following information:
- In the Property field, enter .ScoreSegment.
- In the Label field, enter Score Segment.
- Click Save to return to the Table tab.
- In the if row, enter the following values:
- In the Score <= column, enter 150.
- In the CB Score column, enter 400.
- In the Return column, enter 1.
- In the Score Segment column, enter RED.
- Click the Insert Row After icon to add an else if row:
- Enter the following values in the else if row:
- In the Score <= column, enter 220.
- In the CB Score column, enter 400.
- In the Return column, enter 2.
- In the Score Segment column, enter RED.
- 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
- Click Save, and then close the decision table to return to the Credit Offers decision strategy.
- 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.
- Click Submit to save the 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.
- Open the Test run pane to test the Multi Score Segment decision table:
- In the Settings section, select Data set.
- In the Data set field, enter or select SimulationSetDDS.
- In the Customer ID field, enter or select Customer70.
- Click Save &Run.
- Click the Multi Score Segment decision table component.
- 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
- Right-click the canvas, and then select Business Rules > Decision Table to add the component.
- Right-click the component, and then select Properties to configure the decision table.
- In the Name field, enter Calculate Risk-Based Pricing.
- In the Defined on section, select Strategy result, and then confirm that the CDHOrg-CreditRisk-SR-Origination class is the active selection.
- In the Decision table field, enter Calculate Risk-Based Pricing, and then click the Target icon to create the decision table.
- On the Create Decision Table landing page, ensure that the Apply to class is CDHOrg-CreditRisk-SR-Origination.
- Click Create and open.
- Create a table that consists of four columns, as shown in the following picture:
- On the Parameters tab, enter the following parameter details:
- In the Name field, enter CustomerSegment.
- In the Description field, enter Customer Segment.
- In the Data type field, select Text.
- On the Table tab, in the first column, click the first cell to configure the property, and then enter the following details:
- In the Property field, enter Param.CustomerSegment.
- In the Label field, enter Customer Segment.
- In the Use Operator field, enter =.
- In the second column, click the first cell to configure the property, and then enter the following details:
- In the Property field, enter .pyName.
- In the Label field, enter Product.
- In the Use Operator field, enter =.
- In the Property Values column, to the right of the Return column, click the first cell, and then enter the following details:
- In the Property, enter .RBP.
- In the Label, enter Risk Base Price.
- In the Use Operator, enter =.
- 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
- Click Save, and then close the decision table.
- In the Decision Table Properties dialog box, re-select CalculateRiskBasedPricing.
- Expand the Supply data via section, and then set the CustomerSegment parameter to MultiScoreSegment.ScoreSegment.
- 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.
- On the Credit Offers decision strategy canvas, connect the Only allowed products filter to the Calculate Risk Base Pricing decision table.
- Connect the Calculate Risk Base Pricing decision table to the Prioritized Credit Offers component.
- Delete the connection between the Filter and Prioritize components.
- Rearrange your strategy to resemble the following figure:
- Open the Test run pane to test the Credit Offers decision strategy:
- In the Settings section, select Data set.
- In the Data set field, enter or select SimulationSetDDS.
- In the Customer ID field, enter or select Customer70.
- Click Save & Run.
- Click the Calculate Risk Based Pricing component.
- 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
- Right-click the canvas, and then click Enrichment > Set Property to add the component to the canvas.
- Right-click the new component, and then click Properties.
- In the Name field, enter Offer Calculations, and then click Submit.
- Delete the connection between Calculate Risk-Based Pricing and Prioritized Credit Offers components.
- Connect the Calculate Risk-Based Pricing to the Offer Calculations component.
- Connect Offer Calculations to the Prioritized Credit Offers component.
- Rearrange your strategy to resemble the following figure:
- Right-click the new Set Property component, and then click Properties to configure the component:
- In the Define action, target, and source section, click Add item to add a new target property and its source.
- In the Target field, enter .MaxPayment.
- In the Source field, enter .PTI * (Primary.TotalIncome - Primary.TotalExpenses - EquifaxResponse.CBTotalLiabilities).
- 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)
- 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.
- Delete the connection between the Offer Calculations and Prioritized Credit Offers components.
- Right-click the canvas, and then click Arbitration > Filter to add a Filter component to the canvas.
- Connect the Offer Calculations component to the Filter component.
- Connect the Filter component to the Prioritize Offers component.
- Rearrange your strategy to resemble the following figure:
- Right-click the new Filter component, and then select Properties to configure the component:
- In the Name field, enter Valid Product Offers.
- In the Filter condition, enter .OfferAmount >= .MinAmount.
- Click Submit.
- Expand the Test run pane to test the Credit Offers decision strategy:
- In the Settings section, select Data set.
- In the Data set field, enter or select SimulationSetDDS.
- In the Customer ID field, enter or select Customer70.
- Click Save & Run.
- In the Show component level values for list, select Number of decisions.
- 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
- Right-click the canvas, and then click Enrichment > Set Property to add the component to the canvas.
- Position the new component between the MultiScoreSegment and Results components.
- Connect the Score Segment to the new Set Property component.
- Connect the new Set Property component to the Results component.
- Right-click the Set property component, and then click Properties to configure the component.
- In the Name field, enter Credit Score.
- In the Define action, target, and source section, click Add item to add a new target property and its source.
- In the Target field, enter or select .pyName.
- In the Source field, enter or select .ScoreSegment.
- Click Submit to save the configuration.
- Your strategy should resemble the below figure:
- Open the Test run panel to test the Credit Offers decision strategy:
- In the Settings section, select Data set.
- In the Data set field, enter or select SimulationSetDDS.
- In the Customer ID field, enter or select Customer70.
- Click Save & Run.
- Click on the Credit Score component.
Note: Notice the Name property in the Test run pane.
- Click the Results component.
- In the Test Run pane, in the Results in Credit Offers section, click the arrow to cycle through the pages.
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:
Want to help us improve this content?