
Business rules: predicting with rules, and their limitations
Business rules are if-then rules with which you predict the outcome of a transaction or event from easily measurable starting values. You can translate existing knowledge into rules, or derive new rules from large numbers of events. Both routes work, provided you know their limitations.
Key takeaways
- A business rule has the form IF (condition 1, …, condition n) THEN action. As soon as human behaviour is involved, the rule describes the most probable action, not a certainty.
- There are two ways to obtain rules: translating existing knowledge rules into computer rules and testing them, or deriving rules from the data itself (rule induction).
- Keep the rule set minimal: a rule that adds no information only costs processing time.
- Continuous values such as temperature must first be divided into a few defensible classes.
- With rule induction the threshold determines everything: too low gives too many unlikely rules, too high gives only the obvious.
What are business rules?
A business rule is an if-then rule that predicts the outcome of a transaction or event on the basis of a list of conditions: IF (value 1, value 2, …, value n) THEN action.
Rules in fact govern our whole lives, even though the exception to the rule is popular, certainly with speed limits and parking. Such rules are more or less agreements that make society work. There are also rules that describe phenomena: if you pick up a stone and let go, it falls. These follow the principle IF situation A THEN action B ELSE action C, and there is something inevitable about them; often they are laws of nature. Once human behaviour becomes part of the equation, a rule is no longer a true rule but a description of the most probable action.
Whoever buys bread in a supermarket probably also buys sandwich fillings. Yet not everyone does: there may be enough at home. Conversely, a customer who buys peanut butter may want it for satay sauce. Still, such ‘rules’ allow you to follow large numbers of transactions and, by applying a simple rule to many of them, to estimate its probability. It becomes harder when many events are available but nothing is known in advance about cause and effect. Is there a rule, a system of cooperating rules, or just randomness?
The problem that business rules solve
Business rules are one of the methods of predictive analytics. Besides shopping behaviour there are other situations in which they are used:
- Medical diagnosis: determining from the presence and absence of symptoms whether a patient is ill and with what. A broken leg is easily diagnosed with an X-ray; with complaints such as forgetfulness there is a wide range of possible diseases, and medicines that fight one may promote another.
- Language analysis: by comparing one and the same text in different languages, corresponding patterns and letter groups can be found. This is in fact how Jean-François Champollion deciphered the Rosetta Stone. Without a language to compare with, deciphering becomes much harder.
Two ways to obtain rules
Existing rules versus derived rules
The situation determines which route you take.
Existing knowledge rules
Rule induction
Source
Experts and experience
The data itself
Use of data
Testing reliability
Finding and testing rules
Surprises
None: you find what you look for
Hidden patterns possible
Risk
Inconsistent or incomplete rules
Wrong threshold value
Example
Medical diagnosis
Shopping basket analysis
With a diagnosis you prefer existing medical knowledge: certain combinations of symptoms indicate a certain disease. The rules are translated into rules a computer can use, after which their correctness and probability are determined. With buying behaviour you can search for certain product combinations, but that way you never find unexpected combinations, because you are not looking for them. That changes when you derive new rules and their reliability from a large number of events.
The structure of a rule set
Working with business rules is not without obligation: both the information and the rules must meet conditions in wording and structure. The set of rules should always be the minimal set that can perform the desired action. Suppose a supermarket uses these two rules:
- IF (bread, butter) THEN milk
- IF (bread, butter, cheese) THEN milk
The second rule provides no extra information, but applying it does cost extra time, which is crucial when working through large volumes of data. So it is removed. That is different with IF (bread, butter) THEN chocolate sprinkles and IF (bread, butter, cheese) THEN milk: these are two separate rules, and removing the second gives clearly different results.
The information itself must also be readable in a fixed way. If the purchases of three customers are known (bread and chocolate sprinkles; cheese, jam and milk; bread, butter, cheese and milk), they cannot be used without knowing the number of products per customer. Many of these problems are solved with key-value methods and techniques such as MapReduce.
Continuous values: divide into classes
Continuous numerical values such as blood pressure and body temperature cannot be used directly in rules. Instead you make a division into at most five classes, for body temperature for example: below 35 very low, 36 low, 37 to 38 normal, 38 to 40 high, above 40 very high. By grouping the outer classes you get three classes; only fever or no fever can also be usable. State the chosen division clearly, and make sure it is defensible: a fever threshold at 37 degrees Celsius cannot be defended on medical grounds.
Working with existing rules
Working with existing rules means working with knowledge built up earlier, for three reasons: testing the reliability of the rules against a large number of observations, predicting actions on the basis of known conditions, or both. For predicting buying behaviour the second reason dominates; for a medical diagnosis both matter, because not only the diagnosis but also its reliability counts. The most important operation is converting the available knowledge into an unambiguous set of rules.
Example: hay fever versus allergic asthma
To distinguish hay fever from allergic asthma you draw up a series of rules. The set only answers whether the patient has hay fever; it says nothing about allergic asthma, which can occur separately or in combination. Nine rules of experience can be reduced to three search rules:
- IF ((nose = runny OR nose = blocked) AND sneezing = yes) THEN hay fever = yes
- IF ((nose = runny OR nose = blocked) AND itching = yes) THEN hay fever = yes
- IF (itching = yes AND sneezing = yes) THEN hay fever = yes
These three can in turn be combined into one single rule. Combining all conditions in this way greatly speeds up processing, which matters precisely when data volumes become large. In practice the number of rules of experience can increase considerably; more than twenty is no exception. Reduction is then essential, with algorithms such as LEM1, LEM2 and AQ. Reduction also lets you check the internal consistency better: the more rules, the greater the chance of conflicting or meaningless ones.
Deriving new rules: the Apriori example
If there are no good rules of experience, or you doubt their validity, you can only let the information speak for itself. All transactions or events are then examined for patterns. For analysing transactions you use Apriori, for example; for events, routines such as WINEPI. Suppose a shop knows the purchases of twelve customers:
- Bread, cheese, butter, milk, washing-up liquid
- Bread, butter, jam, milk, chocolate sprinkles
- Bread, cheese, butter, milk
- Bread, jam, water, milk, gingerbread
- Gingerbread, detergent
- Butter, milk, gingerbread
- Bread, butter, jam
- Bread, milk, chocolate sprinkles
- Bread, cheese, milk, washing-up liquid
- Bread, cheese, butter, chocolate sprinkles
- Bread, peanut butter, butter, jam, cheese
- Bread, cheese, butter, detergent
First you set a threshold for the occurrence of a product, here five times, and count per product how often it was bought: bread 10, butter 8, milk 7, cheese 6, jam 4, gingerbread 3, chocolate sprinkles 3, and the rest once or twice. Products below the threshold are left out, because otherwise loose, possibly unique transactions get too much influence, and because searching the whole set for each product takes very long with large sets.
Then all combinations of two products above the threshold are made and counted: bread and butter 7, bread and cheese 6, bread and milk 6, butter and cheese 5, butter and milk 4, milk and cheese 3. The same threshold applies: if a product occurs fewer than five times, so does every combination containing it. Groups of three are tested in the same way: bread, butter and cheese 5; bread, butter and milk 3; bread, milk and cheese 3; butter, cheese and milk 2. All four together occur only twice and remain below the threshold. The result is a rule such as IF (bread, butter) THEN cheese.
The example shows that deriving rules from transactions is laborious. Regardless of the algorithm, the whole data set has to be read several times. With Apriori the number of times the information is read doubles with each extra term.
The limitations of business rules
Using derived rules to search large volumes of information is time-consuming: however advanced the algorithm, several passes through the information are always needed. Even with known rules of experience, the process is quite sensitive to the starting values given to the algorithm. With rules of experience (supervised rule induction) there is always a chance that the rules are inconsistent or incomplete, which software cannot always detect. An incorrect rule set then gives wrong results without this being directly visible. Checking that the rules are correct, complete and consistent is therefore of the utmost importance.
- Threshold too low: too many search terms are included, resulting in a large number of rules. At a threshold of three, jam, gingerbread and chocolate sprinkles are added in the example: three doublings, so the analysis takes eight times as long. The answer also becomes very detailed, with very small probabilities.
- Threshold too high: only a few search terms remain and the system generates a limited number of rules, the obvious ones. At a threshold of eight only bread and butter remain: whoever buys bread probably also takes butter home. You can draw up such a rule without any data analysis.
There are methods to examine the reliability and validity of rules, including whether the right threshold has been chosen. In any professional application of rule induction these checks are necessary.
Decision tree versus rule induction
Both methods use a series of choices, yet they differ and can exist side by side. A decision tree splits a group of information into parts at each selection moment and repeats that until the tree is finished; its structure depends on how the tree is set up. Business rules combine several choices that can be used simultaneously, so that a decision can depend on several factors in one rule, and the final rules are determined by the software. In general you use a decision tree when the division over alternatives is clearly fixed, and business rules when you apply existing knowledge to a set of information or need to extract hidden patterns. That last aspect makes rule induction a real data mining technique: you let the information speak.
How Diamond Decisions applies business rules
Diamond Decisions uses business rules to make the knowledge of experienced employees explicit and testable. After inspiration, business modeling records which decisions follow which rules, data analytics tests those rules against the data and looks for new ones, and the decision makers determine which rules may decide automatically and where a human stays in the loop.
Talk to the author
Rick van der LindenDiamond Decisions
Discuss your question with Rick
Tell us which decision needs to improve. In a no-obligation conversation we show you where your data delivers the most.
Schedule an introduction →Step 3 of our approach
Diamond Data Analytics
A data warehouse that starts with your most important decisions and is ready for conversational AI: a working prototype within 24 hours.
Explore Data Analytics →Frequently asked questions
01
What is a business rule?
An if-then rule that predicts an outcome or prescribes an action on the basis of a list of conditions, for example IF (bread, butter) THEN cheese.
02
What is rule induction?
Deriving rules from data instead of from experts. Algorithms such as Apriori count which combinations occur above a threshold and turn them into rules with a measurable reliability.
03
What is the difference between business rules and a decision tree?
A decision tree splits step by step on one characteristic at a time. A business rule can combine several conditions in one rule. Trees fit when the alternatives are fixed, rules when you apply knowledge or look for hidden patterns.
04
How do you choose the right threshold?
By testing. Too low gives many detailed rules with small probabilities and long computing times; too high gives only obvious rules. Validity checks show whether the chosen value is defensible.
05
Are business rules useful for SMEs?
Yes. Much of an SME’s know-how sits in the heads of a few people. Writing it down as rules and testing it against your own data makes decisions consistent, transferable and suitable for automation.
Further reading
About the author
About Diamond Decisions
Diamond Decisions helps organizations become better by enabling better decisions. We don’t start with data, dashboards or AI, but with the decision that needs to improve, and work back from there to KPIs, data and technology. We do that in four steps: inspiration and alignment, business modeling, analytics and data platform and data-driven decision makers. That way BI and AI don’t remain an IT project, but deliver value every day.

