Skip to main content

Automating Decisions with Decision trees

Archived

3 Tasks

10 mins

Visible to: All users
Beginner Pega Platform 8.4 Case Management English
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded. Click here to continue your progress in the latest version.

Scenario

An organization is launching an application that facilitates loan requests. Customers initiate a loan request and enter their credit score, loan amount, and country. Configure a decision tree and declare expression so that the loan rate is determined automatically based on the credit score, loan amount, and country the customer enters. For this challenge, if the customer specifies Canada as the country, the loan amount does not affect the loan rate. Use the values in the following table:

  Country Credit score > Loan amount > Return
if Canada 800   .0200
if Canada 700   .0275
if Canada 200   .0425
if   800 50000 .0225
if   800 0 .0200
if   700 50000 .0325
if   700 0 .0275
if   200 50000 .045
if   200 0 .0425
otherwise       .07

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

Role Operator ID Password
Application Developer author@loans pega123!

Challenge Walkthrough

Detailed Tasks

1 Configure the Borrower risk adjustment decision tree

  1. From the navigation pane of Dev Studio, click App.
  2. Right-click LoanRequest and click Create > Decision > Decision Tree.
  3. In the Label field, enter Borrower risk adjustment tree.
  4. Click Create and open to create the decision tree.
  5. Click <click here to add a condition> to add a condition.
    Click to add a condition link when configuring a decision tree
  6. In the first empty field, enter or select .Country.
  7. Keep the operator value as =.
  8. In the second empty field, enter Canada.
  9. Click the return drop-down and select continue. An indented, nested condition is displayed.
    Condition if Country = Canada then continue
    Note: If the conditions do not display, save and refresh the decision tree.
  10. Click the nested condition and repeat steps 6-9 to specify the condition if .CreditScore > 800 then return .0200.
    First nested condition, if Credit Score is greater than 800 then return .0200
  11. With the nested condition selected, click Add Row twice to add two additional nested conditions.
    Add row button
  12. Repeat steps 6-9 to define the following conditions:
    Nested conditions if the country is Canada
  13. Select the first top-level condition and click Add Row three times to add three additional top-level conditions.
  14. Repeat steps 6-12 to define the following conditions:
    Credit score and loan amount nested conditions
  15. In the otherwise row, enter the default return value of .07.
  16. Click Save to save the decision tree.

2 Configure the Loan rate declare expression

  1. From the navigation pane, right-click LoanRequest and click Create > Decision > Declare Expression.
  2. In the Target Property field, enter or select .LoanRate.
    Declare expression for Loan rate property
  3. Click Create and open.
  4. In the Build Expressions section, in the Value of drop-down, select Result of Decision Tree.
  5. In the empty field to the right, enter or select BorrowerRiskAdjustmentTree.
    Loan rate declare expression set by BorrowerRiskAdjustmentTree
  6. Click Save.

3 Confirm your work

  1. In the header of Dev Studio, click Create > New > Loan Request to create a new Loan Request case instance.
  2. In the Loan amount field, enter 5000.
  3. In the Credit score field, enter 600.
  4. In the Country drop-down, select Canada.
  5. Click Submit.
  6. Verify that the Loan rate is 4.25%.
    Verify loan rate is 4.25% with loan amount $5000
  7. Create an additional Loan Request case instance.
  8. In the Loan amount field, enter 50000.
  9. In the Credit score field, enter 600.
  10. In the Country drop-down, select Canada.
  11. Click Submit.
  12. Verify that the Loan rate is 4.25%.
    Verify loan rate is 4.25% with loan amount $50000
  13. Optional: Create additional case instances and enter different Credit score, Loan amount, and Country values. Verify that the Loan rate is consistent with the values specified in the Borrower risk adjustment decision tree.


Available in the following mission:

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