Company Info
Technology
Products
Services

 

Spacer gifSpacer gif
Spacer gif
Scianta Intelligence Turning Knowledge into Intelligence

Fuzzy Logic and the Measures of Certainty in eCommerce Expert Systems

Fusing XML and Java-based Expert Applications

©2001 Earl Cox

Form follows function

Louis Henri Sullivan (1856-1924)
The Tall Office Building Artistically Considered (1896)

Se vogliamo che tutto rimanga come e, bisogna che tutto cambi
If we want things to stay as they are, things will have to change

Giuseppe di Lampedusa (1896-1957)
The Leopard (1957) p. 33

The recent down turn in the stock market has intensified the competition among surviving dotcoms as well as among established brick and mortar firms whose marketing arms extend well into the World Wide Web. More and more often these companies are turning to intelligent systems as a way of maintaining their edge in the rapidly changing Internet world. In the past, intelligent systems often meant neural networks. But the fundamentally static nature of neural networks and their dependency on training data often means that they are not flexible and adaptive enough for dynamics of the World Wide Web. Thus businesses are turning to rule-based expert systems also called business rule systems as a way of preserving knowledge, and meeting the demands of change on the Internet.

In this article we will examine the organization of a business rule systems and look at how those rules should be organized and written in order to address the uncertainty and imprecision of business decisions. At the heart of this architecture is the use of fuzzy logic as the principal method of evaluating rules and the use of fuzzy quantifiers and fuzzy numbers as the building blocks of the rules themselves.

A business rule system is, as the name implies, a collection of if-then-else rules. These rules describe the underlying decision and practice logic associated with the interconnected business processes. A modern business rule system consists of a rule repository and a mechanism for accessing and running the rules. The repository is often segmented into a collection of related rule sets these are business policies (or business knowledge bases). Figure 1 illustrates, schematically, the general organization of a business rule repository.

The Structure of a Rule Repository

Figure 1. The Structure of a Rule Repository

Each rule set needs access to local as well as shared resources such as variables, methods, and messages (events). Variables are also decomposed into their underlying semantics. These semantics are represented as a collection of overlapping fuzzy sets. As an example, Figure 2 shows how the variable Customer.Age is broken down into a collection of fuzzy sets that describe a customer based on his or her age.

Fuzzy Sets for Customer Age

Figure 2 Fuzzy Sets for Customer Age

The degree of membership indicates to what degree the age represents the overlying semantic class. These classifications, of course, are dependent on the actual model, and what constitutes the range of Teenager in one context might not be valid in another context. Fuzzy sets, however, allow us to write rules that apply to multiple semantic contexts at the same time given a single piece of information That is, as an example, if we have two rules,

if Customer.Age is Teenager
then DisposableIncome is Moderate;

if Customer.Age is YoungAdult
then DisposableIncome is High;

then both of these rules will execute when the customers age is twenty (20). The amount of evidence and the strength of each rule will, however, be different. A rule repository maintains the fuzzy sets associated for the variables in each business policy and allows model builders to work on the semantic intentions of the policy.

As an integral part of the eCommerce enterprise, whether supporting direct sales or maintaining a globally distributed supply chain, the core component of business modeling rests on the features and flexibility of the rules repository. As Figure 3 illustrates, the business logic rule repository consists of a collection of policies (separate knowledge bases), an inference engine, a database portal connection, and the encapsulation logic that can bind the intelligence to an application (often as an applet or a servlets).

And Integrated Business Rules Environment

Figure 3. And Integrated Business Rules Environment

The repository generally contains several classes of policies: those that manage the analysis of transactions through the eBusiness service (such as collecting click patterns or managing a chopping cart transaction) those that support the internal business function of the organization (such as inventory stabilization, customer cross marketing, or product trend analysis.), and those that evaluate the web environment itself for capacity, throughput, and responsiveness. Policies are activated by conditions in the applet or servlets interface and are executed by the inference engine. An inference engine implements are wide spectrum of machine intelligence capabilities such as backward and forward chaining as well as fuzzy reasoning.

The critical part of the business engine game is the representation of the rules. Conventional ifthen- else rules are often too brittle to handle the ambiguity and imprecision associated with the flux of transactions on an Internet eBusiness site. Fuzzy logics ability to directly address the issues of elasticity, vagueness, and imprecision provides a powerful method for building eCommerce expert systems that encapsulate certainty measurements as part of their fundamental nature. To understand this, we need to understand the nature of fuzzy logic and how it measures certainty and ambiguity.

The Legacy of Aristotle

In the fourth century BC, Aristotle, tutor to Alexander the Great and pupil of Plato, set about explaining the world. He looked about him and imagined that the forces of nature were not necessarily controlled by invisible spirits, but operated on principles that ordinary humans could understand. In his principal scientific works Physica, De Caelo, and De Partibus Animalium (to use their Latin names) he laid out the rules, as he saw them, which determined how arrows flew through space, how objects fell, and how animals sprang from inanimate matter. Aristotles influence was so great that philosophers and scientists up until the time of the late Renaissance could win arguments over the actual mechanics of nature simply by saying magister dixit The Master Said It. The Master, of course, being Aristotle. And, from this slavish obedience to Aristotle, scientific thought languished for two thousand years, right up until Galileo Galilei, in the early seventeenth century began rolling balls of different weights down inclined planes and turned the recently invented telescope skyward to see the moons of Jupiter, mountains on the moon, blemishes on the sun, and individual stars in the Milky Way. And it remained for Louis Pasteur as recently as the late nineteenth century, to show that flies, worms, and spiders did not spontaneously emerge from dead meat and inorganic matter.

When Aristotle finished explaining how the physical world behaved, he turned to a deeper matter (in his mind, at least) explaining how we know what we know. Aristotle set about formulating the rules for separating truth from falsehoods. The result of this effort was his six treatises on logic, collectively known as The Organon, or The Tool. It was Aristotles insight into reasoning that lead him to formulate a way of maintaining the chain of custody of truth through successive steps. These syllogisms, as they are known, have allowed generations of freshmen logic students to wrestles with deep propositions like,

All men are mortal
Socrates is a man
Socrates is mortal

The first part of the syllogism lays down a general proposition, in this case, that all men are mortal (all men will eventually die). The next two lines form an if-then chain of reasoning. The logic says, if Socrates is a man then (or therefore) Socrates is mortal. These if-then statements form not only an implicit part of the way we as humans reason about contingent events, but they lie at the core of modern rule-based machine reasoning systems.

The Crispness of Logic

In Aristotles logic, later updated and extended by George Boole, truth is completely categorical. Something is true or it is false. Your proposition can not be true and false at the same time. Elements are therefore crisply partitioned into sets with well defined boundaries. Aristotle embodied this idea in his statements of the Law of the Excluded Middle and the Law of Non-Contradiction. As an example, consider the set of Short and Tall men. We define Tall Men as,

tall equation
(Exp. 1.1)

meaning that anyone six feet and over is Tall. Conversely, Short Men (the complement of Tall or ~Tall) are less than six feet in height. Expressed as a syllogism, we might pick an person at random and say,

All men six feet and over are Tall
Jack is six feet, eight inches
Jack is Tall

Thus, as Figure 4 shows, heights are crisply and completely partitioned into Tall and Short.

Set of Short and Tall Men

Figure 4 Set of Short and Tall Men
(Membership in the set Tall is shown by the bold line)

From the diagram in Figure 4 we see that membership in the set of Tall Men (the bold line) remains at zero until we reach six feet. At this point, the membership jumps from zero (non-membership) to one (membership). As we will observe later, this behavior is characteristic of Aristotles sets but is not found in sets that use Fuzzy Logic.

The Ambiguity of Nature

Real world phenomena are seldom as clear cut as Aristotles logic. When we begin applying the crisp predicates of Boolean logic to physical processes and real world events we begin to find that the universe at large does not lend itself to the neat, tidy packages of Aristotles crisply articulated sets. The examples that we choose for our logic problems often persuade us that logic does apply to the real world. Thus all men are mortal involves a sharply defined concept: life and death (at least for macroscopic organisms.) But suppose we say something like,

All grass is green
This is a blade of grass
This blade of grass is green

Is this really true? Unlike our previous premise, All Men are Mortal, the assertion that All Grass is Green is not universally true. Grass can be various shades of green, dry grass can be yellow or brown, and grass in Kentucky can be slightly bluish. This means that the statement, if this is a blade of grass then its color is green will not always be true. In more general and fundamental terms, the description of concepts in the real world are not easily categorized into fixed collections. This is because the value of samples randomly selected from a population can take a wide spectrum of continuous values.

This ambiguity is not related to a lack of precision in measuring the height of an individual nor is it related to the probability of finding Short or Tall individuals in the population. Rather, it is a fundamental and intrinsic property of the concepts Short and Tall related to the metric of height. What we need is a way to express this ambiguity in our logic. And such a logic should deal with the uncertainty of set membership in a consistent and mathematically rigorous way so that we can make valid, logical statements about events and objects with ambiguous set memberships. In a logic of partial set memberships, an individual would belong to the set of Short men with degree(Xs) and to the set of Tall men with degree(Xt). Figure 5 shows how such an individual would be represented.

Individual That is Both Tall and Short

Figure 5 Individual That is Both Tall and Short

Placing an individual in both the Short and Tall sets clearly violates Aristotles Law of the Excluded Middle and flies in the face of conventional Boolean logic. If you are Short, you should not also be Tall. Yet even before the time of Aristotle, Greek philosophers such as Heriklietus realized that the world was not Black and White, but was painted in shades of grey. And while early twentieth century philosophers and mathematicians such as Max Black and Jan Lukasiewizc, wrestled with multi-valued logics with various degrees of seriousness and success, the world of science and natural philosophy clung resolutely to the two thousand year old ideas of Aristotle. Magister dixit!

Fuzzy Sets and Model Knowledge

In 1965 Lotfi Zadeh a professor in the department of Electrical Engineering and Electronics Research Laboratory at the University of California, Berkeley - published his seminal paper on the idea of Fuzzy Sets thus establishing the foundation of a comprehensive and mathematically sound logic of imprecisely or ambiguously defined sets. This has come to be known as Fuzzy Logic and was given its first full treatment in Zadehs 1973 paper, [An] Outline of a New Approach to the Analysis of Complex Systems and Decision Process.

Fuzzy Sets

The core idea of Fuzzy Logic rests with the concept of a Fuzzy Set. These sets are not fuzzy in the conventional English-language sense of the word: blurred, hazy, out of focus, or indistinct. Rather they are fuzzy in the way they treat their set boundaries. Fuzzy sets have a semi-permeable membrane. In a fuzzy set, an element can be in three states: not a member of the set, a full member of the set, or a partial member of the set. Set membership is thus represented as a continuous range of values in the interval [0,1] with [0] indicating no set membership, [1] indicating complete set membership, and values in the range [>0,<1] indicating a partial degree of membership. Figure 6 shows one possible fuzzy set representation for the concept Tall Men.

The Fuzzy Set Tall (for Men)

Figure 6 The Fuzzy Set Tall (for Men)

As you can see, a fuzzy set has three principle components: a degree of membership measure along the vertical or Y-axis, the possible domain values for the set along the horizontal or X-axis, and the set membership curve that connects a domain value to its degree of membership in the set (in this case establishing a linear relationship between height and set membership). The connecting curve is the crucial part of the fuzzy set it defines the set membership relations. And this relationship depends intimately on the model context.

What is Fuzziness?

Fuzziness is an intrinsic, descriptive property of a set element. The property that fuzziness describes is class membership. When we construct a fuzzy set to encode the classification of men into Tall or Short, or project durations into Short, Medium, or Long, or the change in angular momentum into Small Positive, Large Positive or Small Negative we are defining what we mean by a representative of that class. A grade of membership, therefore, tells us the degree to which a set element is representative of the class. We can view this representation in two ways. The first is from the perspective of an elements membership and deals with the issues of compatibility. We want to ask: How compatible is the element with the sets concept? The second is from the perspective of the set itself and deals with the tightness or rigidity of the sets boundary. We want to ask: How elastic or permissive is the set boundaries?

Examples of Fuzzy Set Membership

We can see the idea of class representation by examining some members of the fuzzy set Tall (for men) as shown in Figure 7.

Individuals in the Set of Tall Men

Figure 7 Individuals in the Set of Tall Men

The grades or degrees of membership along the vertical axis measure how well the individual represents the class of Tall men. John, at 4 feet is not representative at all and is not a member of the set. Fred, at 6 feet, is completely representative of Tall men and, with a degree of membership of [1], is fully in the set. The other individuals Bill, Jim, and Harry are, to varying degrees, compatible with the idea of Tall men. Bill is only weakly a member if the set, Jim is definitely a member of the set, and Harry is strongly a member of the set.

Meaning and Use of Fuzzy Set Membership

Thus, each degree of membership positions an element in the fuzzy set space. The position marks how well the element (or the elements value) is compatible with the sets overlying concept. A set with a highly elastic boundary will contain more representative members while sets with less elastic boundaries will contain fewer representative members. When we change the shape of a fuzzy set, we alter the meaning of the set and displace its members. This is reflected by a change in the grade of membership assignments associated with each element. Which brings us to a discussion of fuzzy numbers.

Certainty and Fuzzy Numbers

In a broader sense, of course, a degree of set membership is a measure of uncertainty. But, unlike the uncertainty of probability, the fuzzy membership grade reflects the uncertainty of whether or not the element is a member of the set. And a membership marks the element with representational uncertainty how certain are we that this value is compatible with the fuzzy sets concept. In fuzzy systems, uncertainty is reduced, propagated, or increased based on the evidence in the current model state. When constructing eCommerce rules, fuzzy certainty is expressed in the constants and values used in the rule. These are conveniently treated as fuzzy numbers that is, bell shaped distributions around a central value. As an example, in the rule

if price is below around 2*MfgCosts
then ProfitRisk is somewhat increased;

the quantity "2*MfgCosts" is a fuzzy number. Figure 8 illustrates how this number is represented.

The Fuzzy Number 2*MfgCosts

Figure 8. The Fuzzy Number 2*MfgCosts

The certainty of the number (how elastic is its interpretation or, said another way, how ambiguous is the certainty of the value) is expressed as the degree of expectancy (E). When expectancy approaches zero (E=0) then the value 2*MfgCosts is a singleton, that is, it is what we normally consider a precise number. In writing fuzzy rules the width of the fuzzy numbers adds a robustness and fault tolerance to our decision logic that is very difficult to include with crisp rules. The degree to which a value is around 2*MfgCosts in other words, its membership in the bell shaped fuzzy set is used by the model as the amount of evidence that some state is true. Accumulating and exploiting this aggregation of evidence.

Interpreting Fuzzy Memberships

How we interpret and use an elements degree of membership depends, to a large extent, on the current state of the model as well as the mechanism which is reading and interpreting the membership. In fuzzy logic and rule-based fuzzy modeling, degrees of membership, either singularly or combined through some aggregation or discrimination function, play import roles in the evaluation of rules and evidence. Some of the uses include,

  • When used with a fuzzy set, the grade of membership is simply that the degree to which the element is a member of the fuzzy set. This is important in two broad contexts: fuzzy qualifiers (such as Tall) and fuzzy numbers (such as around 2 or near 15).
  • When used with fuzzy rule processing the grades of membership are combined to produce a composite truth of the rules antecedent or premise. This truth determines not only whether or not the rule is fired, but also how much evidence is brought to bear on the outcome fuzzy set (which is scaled according the premise truth).
  • When used in a rule induction process, combined degrees of membership (the fit between data values and fuzzy sets) select one rule from a collection of possible or candidate rules.
  • When used with alpha cut thresholds, the degree of membership decides whether or not an element is in the fuzzy set or whether or not a fuzzy rule is fired.
  • When used with the defuzzification process (reducing an outcome fuzzy set to a single representative value) the maximum grade of membership in the outcome fuzzy set measures the amount of evidence in the solution.

A grade of membership provides the key instrument driving a fuzzy expert or decision support system as well as systems based on machine learning principles (such as rule induction and automatic fuzzy cluster detection). They are, as indicated above, much more than a simple measure of either a set membership or the degree of uncertainty in the set membership.

And Finally...

In the eCommerce sector rule based fuzzy models provide a powerful and robust tool for encapsulating and exploiting knowledge. Fuzzy policies can be used with such architectures as the evolving Java Management Extensions (JMX) to build solutions to many problems in such diverse areas as (for example) online retailing, customer relationship management, supply chain maintenance, just-in-time inventory, new line of business discovery, cross-marketing, and service provisioning and optimization. The use of fuzzy rules coupled fuzzy numbers provides a method of both handling the intrinsic certainty of model states and the accumulation and evaluation of evidence. In the near future, fuzzy rule bases will be connected to knowledge discovery mechanisms that will automatically isolate and generate rules covering both relationships in the data as well as the processes that connect these relationships. In this way, the fuzzy rule base can be use to optimize the eCommerce services and the data mining or rule discovery facilities can be used to optimize policy knowledge. Such an adaptive feed-back engine will ultimately give the eService provider extremely powerful tool for delivering, analyzing, predicting, and controlling their services.

___________________________________

Zadeh, L.A. "Fuzzy Sets", Information and Control, Vol. 8, New York: Academic Press, 1965, pp. 338-353. 2 Zadhe, L.A. "Outline of a New Approach to the Analysis of Complex Systems and Decision Process", IEEE Trans. Systems, Man, and Cybernetics, SMC-3 (1973), pp. 28-44.

TOP OF PAGE

Scianta SI
© Scianta Intelligence 2005 all rights reserved
For more information or to schedule a presentation call (919) 678-0477

Spacer gif Spacer gif nav_top nav_top nav_top nav_top