Introductory Example

If you are a business analyst who has a set of already classified data instances and you want to find business rules that can successfully classify similar new data instances, Rule Learner will help you to automatically discover such business rules from your data.

A generic architecture scheme is shown above. Usually, you create an Excel table of the type “DecisionData” with your training instances and one more table “Glossary” that describes their attributes. Then you run Rule Learner that uses these two tables to generate classification rules in another Excel file.

Problem Description. Let’s assume that you have information about many cases when contact lens were prescribed to different people. Can you use this information to discover human-understandable and machine-executable rules that will allow you to prescribe correct lens to other people?

Training Instances. The known examples are called “training instances” and you can put them in the following Excel table:

Glossary. You need to create another Excel table that describes all attributes in your training instances:

The currently supported types include String, Integer, and Double. The very last attribute in the glossary is considered as a learning attribute (aka CLASS-attribute) that should be determined by the generated classification rules. In this case the the learning attribute is “Contact Lenses”. You may define the learning attribute explicitly by adding the property learning.attribute=”Contact Lenses” to the configuration file “”.

Project Properties. Before running Rule Learner, you need to specify your project-specific properties in the file “”:

Running Rule Learner. To run Rule Learner, you need to click on the standard batch-file “learn.bat“. It will validate your tables “glossary” and “instances” and if everything is OK, will run the default ML algorithm (“RIPPER”) to generate lens recommendation rules.

Generate Rules. The automatically discovered rules will be placed in another Excel file in a ready-to-be-executed OpenRules decision table:

Rule Learner’s execution protocol will also show you the same rules in a text format along with some statistical metrics:

It will also tell you that if you apply these rules to the existing instances, 21 out of 24 have been correctly classified and will show the incorrectly classified instances.

Using Different ML Algorithms. Trying to get more reliable rules, you may try another ML algorithm . You don’t have to change anything in your glossary or instances, just select a different property “learning.classifier” in the standard file “”. If you select “C4.5” classifier instead of “RIPPER”, and run “learn.bat” again, Rule Learner will generate different lens classification rules:

These rules will have slightly better statistical metrics

and they will correctly classify 22 out of 24 existing instances.

The standard Rule Learner installation includes many more examples that demonstrate how you can experiment with different training sets, how to filter them using OpenRules Rule Engine using expert knowledge presented domain-specific rules, and how to transition automatically learned rules into the enterprise’s decision management system.