8) Expressing Business Rules from C5.

This Blog entry is from the Probability and Trees section in Learn R.

In traversing the C5 decision tree it is almost certain that when coming to deploy the model, beyond using the predict() function,  that it will be expressed or programmed as logical statements,  for example:

If Status_Of_Existing_Checking_Account < 200 EUR

AND Credit_History in ("All_Paid","No_Credit_Open_Or_All_Paid")

AND Housing = "Owner"

AND Purpose = "New Car"

AND Duration_In_Month < 22 THEN "Good"

1.png

To display the model as rules rather than a tree, it is necessary to rebuild the model specifying rules argument to be true:

C50Tree <- C5.0(CreditRisk[-1],CreditRisk$Dependent,rules=TRUE)
2.png

Thereafter, the summary() function can be used to output a series of rules created in the rebuild as opposed to a decision tree:

summary(C50Tree)
3.png

Run the line of script to console:

4.png

Scrolling up in the console, it can be observed, towards the top, that in place of a decision tree a series of rules has been created:

5.png

These rules can be deployed with very small modification far more intuitively in a variety of languages, not least SQL.