Docsity

Data Mining: Extraction of Knowledge from Large Datasets, Study notes of Computer Science

Toggle sidebar
bg1
Chapter 9 – Knowledge Engineering and Data Mining
What is Knowledge Engineering?
The basic issue here is how to choose the right tool for the job at hand. At this point in the
course, the student should have become familiar with a number of styles of programming,
including the following:
1) Procedural programming – the standard C++ and Visual Basic stuff. Within this
classification, one includes object-oriented programming (some may disagree).
2) Database programming – laying out databases using tools such as MS-Access or
SQL so that the data can be efficiently retrieved and used. In this instructor’s
experience, the way database programmers think is quite strange and foreign.
3) Rule-based expert systems – these apply rules that are obtained from domain
experts to solution of problems that are best expressed in these terms. As we
have seen and will see again, an explanation facility is very important here.
4) Fuzzy logic – although this is not technically a separate programming style, as
it would be normally used in either procedural programming or rule-based systems.
5) Artificial Neural Networks – these use artificial neurons, either implemented in
hardware or simulated in software, to mimic processes seen in animals, such as
the classification of objects based on digital data.
6) Genetic Algorithms – these use methods motivated by biological evolution to
move through a very large solution space to find solutions that optimize certain
factors, called fitness functions.
There is a saying that was current in the study of Artificial Intelligence in the late 1970’s.
“If the only tool you know is a hammer, everything looks like a nail.”
The saying is placed within the story of a carpenter who, never having seen a screwdriver,
attempts to use a hammer to drive a screw into a board. The point is obvious, for many tasks
there are one or two tools that seem to be best.
Within the context of Artificial Intelligence, there are a few guidelines that are worth
mention when considering a selection of tools, also called programming styles. Before
giving these considerations, let’s review an approach from software engineering. All new
software replaces an existing process, sometimes manual and sometimes implemented by a
previous program.
There are four steps in creating new software. These must be done in order.
1) Determine what they are doing.
2) Determine why they are doing it.
3) Determine why you want to change what they are doing.
4) Determine what you want to do in the new process.
These four steps are not restricted to any style of programming, nor do they relate directly to
our discussion. Nevertheless, they are important enough to be stated here.
Version of 11/28/2020 Chapter 9 Page 1 of 13 pages
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Data Mining: Extraction of Knowledge from Large Datasets and more Study notes Computer Science in PDF only on Docsity!

Chapter 9 – Knowledge Engineering and Data Mining

What is Knowledge Engineering? The basic issue here is how to choose the right tool for the job at hand. At this point in the course, the student should have become familiar with a number of styles of programming, including the following:

  1. Procedural programming – the standard C++ and Visual Basic stuff. Within this classification, one includes object-oriented programming (some may disagree).
  2. Database programming – laying out databases using tools such as MS-Access or SQL so that the data can be efficiently retrieved and used. In this instructor’s experience, the way database programmers think is quite strange and foreign.
  3. Rule-based expert systems – these apply rules that are obtained from domain experts to solution of problems that are best expressed in these terms. As we have seen and will see again, an explanation facility is very important here.
  4. Fuzzy logic – although this is not technically a separate programming style, as it would be normally used in either procedural programming or rule-based systems.
  5. Artificial Neural Networks – these use artificial neurons, either implemented in hardware or simulated in software, to mimic processes seen in animals, such as the classification of objects based on digital data.
  6. Genetic Algorithms – these use methods motivated by biological evolution to move through a very large solution space to find solutions that optimize certain factors, called fitness functions. There is a saying that was current in the study of Artificial Intelligence in the late 1970’s. “If the only tool you know is a hammer, everything looks like a nail.” The saying is placed within the story of a carpenter who, never having seen a screwdriver, attempts to use a hammer to drive a screw into a board. The point is obvious, for many tasks there are one or two tools that seem to be best. Within the context of Artificial Intelligence, there are a few guidelines that are worth mention when considering a selection of tools, also called programming styles. Before giving these considerations, let’s review an approach from software engineering. All new software replaces an existing process, sometimes manual and sometimes implemented by a previous program. There are four steps in creating new software. These must be done in order.
  7. Determine what they are doing.
  8. Determine why they are doing it.
  9. Determine why you want to change what they are doing.
  10. Determine what you want to do in the new process. These four steps are not restricted to any style of programming, nor do they relate directly to our discussion. Nevertheless, they are important enough to be stated here.

Here are a few rules that seem appropriate in selecting a programming style.

  1. If the process is already being addressed by a software solution, consider carefully the style in use. It may be better to write the new software in the same style. Depending on the corporate culture, this may be an important consideration or may be of little concern. Changing styles (say from procedural to rule-based) should be explained with a coherent argument that includes presentation of at least one test case that illustrates the advantages of the new software approach.
  2. If the problem admits of an efficient algorithmic solution, this is strong reason to use the procedural approach. For example, computation of Bessel functions, Spherical Harmonic functions, and other such mathematical constructs should always be done by software written in a procedural style, as there are well-known algorithms to compute the value of these objects.
  3. If the problem is associated with users who will demand an explanation of the answers and the reasoning used to obtain it, it is better to use rule-based systems. There are many examples from medical practice in which software written with the procedural approach produced fine answers that were mistrusted by the medical staff because the software could not explain its reasoning. 4, When interviewing a domain expert, pay a lot of attention to how she or he describes the problem. This is often a guide to the best method for solution.
  4. Consider carefully the quality of the data to be input into the software. Are the data complete and consistent? Some software design strategies, notably the procedural methods, handle incomplete and inconsistent data less well. Problem Classification Problems that are best solved by non-algorithmic methods fall into several classes. Diagnosis Inferring malfunctions of an object from observing its behavior and recommending solutions (cures), Selection Recommending the best option from a list of possible alternatives. Prediction Predicting the future behavior of an object from observations of its past behavior. This class of problems might be better solved procedurally. Classification Assigning an object to one of a number of defined classes, such as the process in biology of assigning an animal to a species and genus. Clustering Dividing a group of objects into homogeneous subgroups. Optimization Finding a solution that maximizes or minimizes a well-described function, often called an “objective function” or “fitness function”. Control Controlling an object or machine based on real-time measurements of the object’s behavior, such as controlling a boiler based on the output of sensors measuring the temperature and pressure of the steam.

Here is one simple example related to what this instructor calls the “doghouse problem”. One might build a small house, the size of a doghouse, to be a prototype of a full-sized house for a family. This would allow certain features to be visualized and better design options to be decided upon, but never would be itself modified into a habitation for humans. For one thing, a doghouse will lack the necessary foundation structure. Early Test Cases In commercial software development, test cases are often defined late in the software development process. This can lead to a common fallacy of developing the test cases with special care that the existing software will pass all the tests. The best time for definition of a set of test cases is at the same time that the system requirements are being developed. One may reasonably ask how one can write requirements for a system without also stating what it would mean for the system to fail to meet the requirements. Each requirement should automatically generate at least one test case to detect its being met; this can be done early. Admittedly, the set of test cases should evolve as the software proceeds through the development cycle. But one should have a good set of tests at the start. Data mining and knowledge engineering We now introduce the last major topic to be covered in this course. The basic problem addressed here is the extraction of information from a lot of data. We perform such functions all the time, indeed one of the driving forces of human evolution seems to be the ability to recognize patterns in data and draw conclusions, such as how to avoid locations likely to hide dangerous animals. For one example of pattern recognition, the reader should examine the figure at right, which is really a collection of integers, each representing a color value. We do not think of this as such a collection, we humans see a picture. Many of us would immediately recognize the face as that of Ozzy Osbourne. The student is invited to speculate as to why this instructor has suddenly become fascinated with Ozzy, as this instructor has never listened to any of Ozzy’s music and up to a few years ago had never heard of him. The source of this picture is a web page linked from the CNN web site. The link is http://www.cnn.com/2003/SHOWBIZ/TV/12/09/osbourne.accident/index.html The important issue in recognizing this picture is that we did not process the data in any structured manner. We immediately extract the information from the data, almost without thought. In particular, we did not start processing a list of famous people to find a matching picture: “Is this a picture of George Bush?” – “No”, “Is this a picture of Elvis?” – “No”, etc.

In a similar way, we could treat a database as a collection of data to be processed by database queries. But that would require that we know what we are looking for or have a list of likely possibilities. The book calls this the use of assumption-based tools ; you tell me what you are looking for and I can tell you if you have found it. But suppose that you do not have a preconceived notion of what the data contain. How do you issue a query such as “Select all records in which there is a field having an interesting value” without specifying which field and what interesting value. One of this instructor’s favorite examples of discovery is related to the March 1979 encounter of the probe Voyager I with the moon Io, a satellite of Jupiter. According to this instructor’s memory, an assistant at NASA was processing images from the Voyager I probe, looking for something else in the data, when she noticed the image at right. It was soon recognized as an active volcano on the moon Io and was quickly explained as being due to gravitational heating of the moon by its interaction with the planet Jupiter. Again, a fortuitous discovery. The source of this image is the web site of the NASA Jet Propulsion Laboratory. http://photojournal.jpl.nasa.gov/target/Io?subselect=Spacecraft%3AVoyager+1%3A&start= Ancient Data Mining The textbook mentions a very ancient example of a practice that can be called data mining in that it involved extraction of patterns from a multitude of observations. Most of us think of astronomy as looking through large telescopes at the planets and stars. However, for all but the last 400 years (since Galileo used a telescope in 1609 to look at the planets Jupiter and Saturn) that we have used telescopes in astronomy. Prior to that, all astronomy could do was to track the paths of the planets and stars through the night sky. Very early, perhaps as early as the creation of Stonehenge in England, people discovered monthly and yearly patterns in the observations. The information they extracted from these data is called a calendar. We might well ask why this process resembles data mining more than other possible processes. The answer is that the ancients did not systematically examine all of the approximately 5,000 stars visible to the naked eye for examination and analysis (See http://www.abc.net.au/science/news/space/SpaceRepublish_910295.htm), but instead focused on the ones that attracted their attention – the sun, moon, and major planets (Mercury, Venus, Mars, Jupiter, and Saturn). Two Medical Examples We next discuss two examples (taken from the book The Great Influenza, by John M. Barry, published by Viking Press in 2004, ISBN 0-670-89473-7) from the medical research of the 18 th^ and 19th^ centuries that could have been good cases of data mining, had they any way of implementing the technique.. The first involved the discovery of the smallpox vaccine. In 1798, Edward Jenner heard a milkmaid say “I cannot take the smallpox because I have had cowpox”. Mr. Jenner observed this pattern – that infection with cowpox granted immunity to smallpox. That one observation lead to the development of a safer smallpox vaccine and eventually to the eradication of that disease in the 20th^ century.

We have already seen one significant application of data mining when we studied artificial neural networks previously. This is the use of artificial neural networks by Chase Manhattan Bank to examine data on the use of stolen credit cards and discovered that the most suspicious sales were for women’s shoes costing between $40.00 and $80.00. This is a perfect example of the discovery of an unanticipated pattern in a large amount of data. The essential question in data mining is how to automate the discovery of patterns in data, by which we mean the identification of structure that has not previously been suspected to exist. The book compares data mining to hard-rock mining, such as the search for gold. The analogy is valid in that real information is valuable and uncommon in the piles of data that must be examined. One way in which the analogy fails is that hard-rock mining typically separates a valuable mineral from material of no use, often called “tailings”. In data mining, the data that are rejected for one application might remain valuable for another. Another way in which the analogy fails is due to the fact that the term is somewhat of a misnomer. Remember that we are mining data in order to retrieve information. As our favorite reference puts it “Simply stated, data mining refers to extracting or “mining” knowledge from large amounts of data. The term is actually a misnomer. Remember that the mining of gold from rocks or sand is referred to as gold mining rather than rock or sand mining. Thus, data mining should have been more appropriately named “knowledge mining from data”, which unfortunately is somewhat long”. [DM 5] Often the data of interest are stored in large amounts (billions of records) in a facility called a data warehouse. Our reference defines a data warehouse as “a repository of multiple heterogeneous data sources, organized under a unified schema at a single site in order to facilitate management decision making” [DM 3]. While it should be obvious that value can be obtained by use of traditional database tools, such as queries, on data stored in a data warehouse, we focus on techniques that will assist in information discovery. In the above discussion, we note that a data warehouse is frequently a repository for heterogeneous data, by which we mean data contained in a variety of different database types. The best probable situation is that all of the databases will process standard SQL queries and precompiled procedures. As we shall see in a minute, data in data warehouses often have been preprocessed in order to facilitate their use when needed. We now consider the basic steps involved in data mining. Broadly speaking, these fall into two classes

  1. Populating the data warehouse, and
  2. Extracting data from the data warehouse.

Basic Steps in Data Mining Here are the seven steps of data mining, taken from our favorite reference. First we populate the data warehouse by preprocessing the data and making them available through some sort of common schema. “1. Data cleaning (to remove noise and inconsistent data). 2 Data integration (where multiple data sources may be combined).” [DM 7] Having established our data warehouse, we now propose to use it. Extraction of knowledge from the data involves the following steps. “3. Data selection (where data relevant to the analysis task are retrieved from the database).

  1. Data transformation (where data are transformed or consolidated into forms appropriate for mining by performing summary or aggregation operations, for instance).
  2. Data mining (an essential process where intelligent methods are applied in order to extract data patterns).
  3. Pattern evaluation (to identify the truly interesting patterns representing knowledge based on some interestingness measures).
  4. Knowledge representation (where visualization and knowledge representation techniques are used to present the mined knowledge to the user).” [DM 7] Components of a Data Mining System A typical data mining system has a number of components, both hardware and software. This section is paraphrased from [DM 7 – 9].
  5. The Information Repository – this is a set of databases and spreadsheets containing the information to be processed. Recall that a data warehouse usually comprises a heterogeneous set of data sources.
  6. The Database Server – the software & hardware system responsible for fetching the relevant data.
  7. The Knowledge Base – this is the domain knowledge that is used to guide the search for interesting patterns in the data. In general, blind searching for patterns in the data will yield too many data to be useful. The knowledge base includes user beliefs and expectations, as well as constraints and thresholds on the data.
  8. The Data Mining Engine – this contains a set of functional modules for cluster analysis, characterization, classification, and association analysis of data.
  9. The Pattern Evaluation Module – this component employs measures of interest in the data and serves to focus the search towards those interesting patterns.
  10. The Graphical User Interface – this module presents the patterns of interest in a way that the user can easily comprehend.

There are two important measures associated with association analysis. These measures are called support and confidence. Formally speaking for association rule “X  Y”, support (X  Y) == P(X  Y), the probability that a transaction record contains one or both of entries X and Y confidence (X  Y) == P(Y | X), the probability that a transaction record containing an X entry also contains a Y entry. We now repeat and expand the above association rule that might have been noted in processing the data records of an electronics store. age (P, “20 … 29”) AND income (P, “20K … 29K”)  buys (P, “CD player”) [support = 2%, confidence = 60%] This indicates that of all the customer records under study

  1. 2% ( support ) are 20 to 29 years of age, with an income in the range 20, to 29,000 or have purchased a CD player at the electronics store, and
  2. there is a 60% probability ( confidence , or certainty) that a customer in this age and income bracket have purchased a CD player. The Decision Tree as a Data-Mining Tool One of the most popular tools for use in data mining is called a decision tree , which is a structure that can be called a map of the decision process. As presented in the textbook, a decision tree is a modified binary tree, with the standard node classifications: root, interior, and leaf nodes. The tree always starts at the root node and generates new nodes which correspond to subsets of the data satisfying specific questions. The figure below shows the basic structure of a decision tree. Figure: Basic Structure of a Decision Tree The student should not take the figure above too literally; in fact, it should be quite possible for the “Yes” child node to be on the right while the “No” child is on the left. One should probably use a consistent convention when displaying a decision tree. At any given time, a decision tree will have one root node and a number of interior and leaf nodes. Each node is labeled in two ways:
  1. Explicitly by some objective function that one wants to minimize or maximize, and
  2. Implicitly by the path (sequence of decisions) from the root to that node. We have said that data mining refers to the attempt to extract knowledge from data. Consider the following very simple decision tree (with fake data), based on the story about the smallpox vaccine. In this figure, we imagine a random sample of 1000 persons taken during a cholera epidemic. The figures of merit (objective functions) are obviously the percentage of the population infected and the percentage that died from the disease. Again, the numbers in this example are purely due to the imagination of the instructor. Upon reviewing this decision tree, any person would immediately recognize that it represents a significant insight – that previous exposure to cowpox seems to confer immunity to smallpox. This, in fact, is true. Let’s now look at the first two levels of the decision tree of figure 9.25 on page 333. We shall comment on this figure in a bit more detail later, but for now we ask where the figure $20,700 came from? The answer is related to the measure called the Gini Index or the Gini Coefficient. What we are trying to do is examine each possible dependent variable and determine whether or not there is a value of this dependent variable that allows us to separate nodes with the desired objective measure from those that do not.

Cluster Analysis In cluster analysis we divide the objects into clusters , which are groupings of objects in which similar objects are placed into the same class. The desire is that

  1. two objects in the same class are as similar as possible, and
  2. two objects in different classes are quite dissimilar. Each cluster that is formed can be viewed as a class of objects for which rules can be derived. In the above example, we might note something significant about a location near the center of each cluster, for example a service center related to customers at each location. Outlier Analysis In cluster analysis, one wonders about what to do with the outliers, which are data items that do not fit easily into a cluster. For many types of analysis, we want to discard these outliers as noise in the data. There are certain cases, such as credit-card fraud detection, for which the outliers are of more interest than members of the well-formed clusters. References for this chapter Books
  1. The Great Influenza, by John M. Barry, published by Viking Press in 2004, ISBN 0-670-89473-7.
  2. Data Mining: Concepts and Techniques, by Jiawei Han and Micheline Kamber, published by Morgan Kaufmann Publishers in 2001, ISBN 1-55860-489-8. Citations to this book are listed as [DM page_number]. Web Sites http://www.cnn.com/2003/SHOWBIZ/TV/12/09/osbourne.accident/index.html http://photojournal.jpl.nasa.gov/target/Io?subselect=Spacecraft%3AVoyager+1%3A&start= http://www.abc.net.au/science/news/space/SpaceRepublish_910295.htm http://www.csiss.org/classics/content/