Introduction to Data Mining


Published on

This lecture gives various definitions of Data Mining. It also gives why Data Mining is required. Various examples on Classification , Cluster and Association rules are given.

Published in: Education, Technology

Introduction to Data Mining

  1. 1. Introduction to Data Mining Dr. Sushil Kulkarni Jai Hind College (
  2. 2. — Introduction to database — A Problem and A Solution — What Is Data Mining? — Goal of Data Mining — What is (not) Data Mining? — Convergence of 3 key Technologies — Data mining Functions — Kinds of Data Mining Problems Road Map
  3. 3. What is Database? <ul><li>A database is any organized collection of data. </li></ul>
  4. 4. Examples <ul><ul><li>Co-workers </li></ul></ul>
  5. 5. Examples <ul><ul><li>Patient Information </li></ul></ul>
  6. 6. Examples <ul><ul><li>Airline reservation system </li></ul></ul>
  7. 7. Data vs. information <ul><li>What is data ? </li></ul><ul><ul><li>Data is unprocessed information. </li></ul></ul><ul><li>What is information ? </li></ul><ul><ul><li>Information is data that have been organized and communicated in a coherent and meaningful manner. </li></ul></ul><ul><ul><li>Data is converted into information, and information is converted into knowledge . </li></ul></ul><ul><ul><li>Knowledge; information evaluated and organized so that it can be used purposefully. </li></ul></ul>
  8. 8. Why do we need a database? <ul><li>Keep records of our: </li></ul><ul><ul><li>Clients </li></ul></ul><ul><ul><li>Staff </li></ul></ul><ul><ul><li>Volunteers </li></ul></ul><ul><li>To keep a record of activities and interventions </li></ul><ul><li>Keep sales records </li></ul><ul><li>Develop reports </li></ul><ul><li>Perform research </li></ul>
  9. 9. Purpose of Database system Data Information Knowledge Action Is to transform
  10. 10. Database <ul><li>Database: Shared collection of logically related data (and a description of this data), designed to meet the information needs of an organization. </li></ul><ul><li>Database management System: A software system that enables users to define, create, and maintain the database and that provides controlled access to this database. </li></ul>
  11. 11. Who and How to do it ? <ul><li>Database Management System (DBMS) does this job. </li></ul><ul><li>Using Software tools: Access, FileMaker, Lotus Notes, Oracle or SQL Server, ……. </li></ul><ul><li>It includes tools to add, modify or delete data from the database, ask questions (or queries) about the data stored in the database and produce reports summarizing selected contents. </li></ul>
  12. 12. hmm.. Let’s jump to Data Mining <ul><li>With this background we will now see what is data Mining </li></ul>
  13. 13. A Problem … <ul><li>You are a marketing manager of a brokerage company </li></ul><ul><li>— Problem: Churn is too high </li></ul><ul><li>> Turnover is 40% </li></ul><ul><li>(after six month introductory period ends) </li></ul><ul><li>— Customers receive incentives </li></ul><ul><li>(average cost: ₹ 160) when account is opened </li></ul><ul><li>— Giving new incentives to everyone who might </li></ul><ul><li>leave is very expensive (as well as wasteful) </li></ul><ul><li>— Bringing back a customer after they leave is </li></ul><ul><li>both difficult and costly </li></ul>
  14. 14. A Solution … <ul><li>— One month before the end of the introductory period is </li></ul><ul><li>over, predict which customers will leave </li></ul><ul><li>— If you want to keep a customer that is predicted to churn, offer them something based on their predicted value </li></ul><ul><li>> The ones that are not predicted to churn need no </li></ul><ul><li>attention </li></ul><ul><li>— If you don’t want to keep the customer, do nothing </li></ul><ul><li>— How can you predict future behavior? </li></ul><ul><li>> Tarot Cards </li></ul><ul><li>> Magic 8 Ball </li></ul>
  15. 15. KDD Process <ul><li>Knowledge discovery in databases (KDD) is a multi step process of finding useful information and patterns in data </li></ul><ul><li>Data Mining is the use of algorithms to extract information and patterns derived by the KDD process. </li></ul><ul><li>Many texts treat KDD and Data Mining as the same process, but it is also possible to think of Data Mining as the discovery part of KDD. </li></ul>
  16. 16. Steps of KDD Process <ul><li>Many texts treat KDD and Data Mining as the same process, but it is also possible to think of Data Mining as the discovery part of KDD. </li></ul><ul><li>Knowledge discovery in databases (KDD) is a multi step process of finding useful information and patterns in data </li></ul><ul><li>Data Mining is the use of algorithms to extract information and patterns derived by the KDD process. </li></ul>
  17. 17. Steps of KDD Process <ul><li>1. Selection- </li></ul><ul><li>Data Extraction -Obtaining Data from heterogeneous data sources -Databases, Data warehouses, World wide web or other information repositories. </li></ul><ul><li>2. Preprocessing- </li></ul><ul><li>Data Cleaning- Incomplete , noisy, inconsistent data to be cleaned- Missing data may be ignored or predicted, erroneous data may be deleted or corrected. </li></ul><ul><li>3. Transformation- </li></ul><ul><li>Data Integration- Combines data from multiple sources into a coherent store -Data can be encoded in common formats, normalized, reduced. </li></ul>
  18. 18. Steps of KDD Process <ul><li>4. D ata mining – </li></ul><ul><li>Apply algorithms to transformed data an extract </li></ul><ul><li>patterns. </li></ul><ul><li>5. Pattern Interpretation/evaluation </li></ul><ul><li>Pattern Evaluation- Evaluate the interestingness of resulting patterns or apply interestingness measures to filter out discovered patterns. </li></ul><ul><li>Knowledge presentation- present the mined knowledge- visualization techniques can be used. </li></ul>
  19. 19. What Is Data Mining? <ul><li>Some Definitions </li></ul><ul><li>“ The nontrivial extraction of implicit, previously unknown, and potentially useful information from data ” (Piatetsky-Shapiro) </li></ul><ul><li>&quot;...the automated or convenient extraction of patterns representing knowledge implicitly stored or captured in large databases , data warehouses, the Web, ... or data streams.&quot; (Han, pg xxi) </li></ul><ul><li>“ ...the process of discovering patterns in data . The process must be automatic or (more usually) semiautomatic. The patterns discovered must be meaningful ...” (Witten, pg 5) </li></ul><ul><li>“ ... finding hidden information in a database .” (Dunham, pg 3) </li></ul><ul><li>“ ...the process of employing one or more computer learning techniques to automatically analyse and extract knowledge from data contained within a database .” (Roiger, pg 4) </li></ul>
  20. 20. Why Data Mining? <ul><li>That all sounds ... complicated. Why should I learn about Data Mining? </li></ul><ul><li>What's wrong with just a relational database? Why would I want to go through these extra [complicated] steps? </li></ul><ul><li>Isn't it expensive? It sounds like it takes a lot of skill, programming, computational time and storage space. </li></ul><ul><li>Where's the benefit? </li></ul><ul><li>Data Mining isn't just a cute academic exercise, it has very profitable real world uses. Practically all large companies and many governments perform data mining as part of their planning and analysis. </li></ul>
  21. 21. Goal of Data Mining <ul><li>— Simplification and automation of the overall </li></ul><ul><li>statistical process, from data source (s) to model </li></ul><ul><li>application </li></ul><ul><li>— Changed over the years </li></ul><ul><li>> Statistician replace data to a model </li></ul><ul><li>> Many different data mining algorithms / tools </li></ul><ul><li>available </li></ul><ul><li>> Statistical expertise required to build intelligence </li></ul><ul><li>into the software </li></ul>
  22. 22. Data Mining is …
  23. 23. What is (not) Data Mining? <ul><li>What is Data Mining? </li></ul><ul><ul><li>Certain names are more common in certain locations of Mumbai (Kulkarni, Shah, Iyer… ) </li></ul></ul><ul><ul><li>Group together similar documents returned by search engine according to their context (e.g. Amazon rainforest,,) </li></ul></ul><ul><li>What is not Data Mining? </li></ul><ul><ul><li>Look up phone number in phone directory </li></ul></ul><ul><ul><li>Query a Web search engine for information about Amazon” </li></ul></ul>
  24. 24. DB VS DM Processing <ul><li>Query </li></ul><ul><ul><li>Well defined </li></ul></ul><ul><ul><li>SQL </li></ul></ul><ul><li>Query </li></ul><ul><ul><li>Poorly defined </li></ul></ul><ul><ul><li>No precise query language </li></ul></ul><ul><li>Data </li></ul><ul><ul><li>Operational data </li></ul></ul><ul><li>Output </li></ul><ul><ul><li>Precise </li></ul></ul><ul><ul><li>Subset of </li></ul></ul><ul><ul><li>database </li></ul></ul><ul><li>Data </li></ul><ul><ul><li>Not operational data </li></ul></ul><ul><li>Output </li></ul><ul><ul><li>Fuzzy </li></ul></ul><ul><ul><li>Not a subset </li></ul></ul><ul><ul><li>of database </li></ul></ul>
  25. 25. Convergence of 3 key Technologies
  26. 26. 1. Increasing Computing Power <ul><li>— Moore’s law doubles computing power </li></ul><ul><li>every 18 months </li></ul><ul><li>— Powerful workstations became common </li></ul><ul><li>— Cost effective servers (SMPs) provide </li></ul><ul><li>parallel processing to the mass market </li></ul><ul><li>— Interesting tradeoff: </li></ul><ul><li>< Small number of large analyses vs. large </li></ul><ul><li>number of small analyses </li></ul>
  27. 27. 1. The Data Explosion <ul><li>The rate of data creation is accelerating each year. In 2003, UC Berkeley estimated that the previous year generated 5 exabytes of data, of which 92% was stored on electronically accessible media. Mega < Giga < Tera < Peta < Exa ... All the data in all the books in the US Library of Congress is ~136 Terabytes. So 37,000 New Libraries of Congress in 2002. </li></ul><ul><li>VLBI Telescopes produce 16 Gigabytes of data every second. </li></ul><ul><li>Google searches 18 billion+ accessible web pages. </li></ul>
  28. 28. 1. The Data Explosion Implications <ul><li>As the amount of data increases , the proportion of information decreases . </li></ul><ul><li>As more and more data is generated automatically, we need to find automatic solutions to turn those stored raw results into information. </li></ul><ul><li>Companies need to turn stored data into profit ... Otherwise why are they storing it? </li></ul>
  29. 29. 2. Improved Data Collection and Management <ul><li>— Data Collection ? Access ? Navigation ? Mining </li></ul><ul><li>— The more data the better (usually) </li></ul>
  30. 30. 3. Statistical & Machine Learning Algorithms <ul><li>— Techniques have often been waiting for computing </li></ul><ul><li>technology to catch up </li></ul><ul><li>— Statisticians already doing “manual data mining” </li></ul><ul><li>— Good machine learning is just the intelligent </li></ul><ul><li>application of statistical processes </li></ul><ul><li>— A lot of data mining research focused on tweaking existing techniques to get small percentage gains </li></ul>
  31. 31. 3.Data/Information/Knowledge/Wisdom <ul><li>For example , a data mining application may tell you that there is a correlation between buying music magazines and beer , but it doesn't tell you how to use that knowledge. Should you put the two close together to reinforce the tendency, or should you put them far apart as people will buy them anyway and thus stay in the store longer? </li></ul><ul><li>Data mining can help managers plan strategies for a company, it does not give them the strategies. </li></ul>
  32. 32. Data mining Functions <ul><li>All Data Mining functions can be thought of as attempting to find a model to fit the data. </li></ul><ul><li>Each function needs criteria to create one model over another. </li></ul><ul><li>Each function needs a technique to compare the data. </li></ul><ul><li>Two types of model: </li></ul><ul><li>– Predictive models predict unknown values based </li></ul><ul><li>on known data </li></ul><ul><li>– Descriptive models identify patterns in data </li></ul>
  33. 33. Data mining Functions
  34. 34. Predictive Model <ul><li>— A “black box” that makes predictions about </li></ul><ul><li>the future based on information from the </li></ul><ul><li>past and present </li></ul>— Large number of inputs usually available
  35. 35. Kinds of Data Mining problems <ul><li>Database </li></ul><ul><li>Data Mining </li></ul><ul><ul><ul><ul><ul><li>Find all customers who have purchased milk </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Find all items which are frequently purchased with </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>milk. (association rules) </li></ul></ul></ul></ul></ul><ul><li>Find all credit applicants with Aditi as first name </li></ul><ul><ul><li>Identify customers who have purchased </li></ul></ul><ul><ul><li>more than ₹ 10,000 in the last month </li></ul></ul><ul><ul><li>Find all credit applicants who are poor credit risks. </li></ul></ul><ul><ul><li>(classification) </li></ul></ul><ul><ul><ul><ul><ul><li>Identify customers with similar buying habits. </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>(Clustering) </li></ul></ul></ul></ul></ul>
  36. 36. <ul><li>Classification </li></ul><ul><li>Clustering </li></ul><ul><li>Association Rule </li></ul>Kinds of Data Mining problems
  37. 37. Classification Classification Model
  38. 38. Definition of Classification Problem Given a database D={t 1 ,t 2 ,…,t n } and a set of classes C={C 1 ,…,C m }, the Classification Problem is to define a mapping f: D  C where each t i is assigned to one class .
  39. 39. Example: Credit Card Training Set Learn Classifier Test Set Model
  40. 40. Another Example ... <ul><li>In which group, these object belongs to ? </li></ul>Group 1: Delia Group 2: Roses Target Object (Experiment reported on in Cognitive Science, 2002) oopps
  41. 41. Resemblance <ul><li>People classify things by finding other items that are similar which have already been classified. </li></ul><ul><li>For example: Is a new species a bird ? Does it have the same attributes as lots of other birds? If so, then it's probably a bird too. </li></ul><ul><li>A combination of rote memorization and the notion of </li></ul><ul><li>'resembles'. </li></ul><ul><li>Although kiwis can't fly like most other birds, they resemble </li></ul><ul><li>birds more than they resemble other types of animals. </li></ul><ul><li>So the problem is to find which instances most closely </li></ul><ul><li>resemble the instance to be classified. </li></ul>
  42. 42. Few More Examples <ul><li>Loan companies can “give you results in minutes” by classifying you into a good credit risk or a bad risk, based on your personal information and a large supply of previous, similar customers. </li></ul><ul><li>Cell phone companies can classify customers into those likely to leave, and hence need enticement, and those that are likely to stay regardless. </li></ul><ul><li>The data generated by airplane engines can be used to determine when it needs to be serviced . By discovering the patterns that are indicative of problems, companies can service working engines less often (increasing profit) and discover faults before they materialise (increasing safety). </li></ul>
  43. 43. Clustering <ul><li>Classification is supervised learning the supervision comes from labeling the instances with the class. </li></ul><ul><li>Clustering is unsupervised learning -- there are no predefined class labels, no training set. </li></ul><ul><li>So our clustering algorithm needs to assign a cluster to each instance such that all objects with the same cluster are more similar than others. </li></ul>
  44. 44. Clustering <ul><li>Finding groups of objects such that the objects in a group will be similar (or related) to one another and different from (or unrelated to) the objects in other groups </li></ul><ul><li>The goal is to find the most 'natural' groupings of the instances. </li></ul><ul><li>- Within a cluster: Maximize similarity between instances. </li></ul><ul><li>- Between clusters: Minimize similarity between instances. </li></ul>Inter-cluster distances are maximized Intra-cluster distances are minimized
  45. 45. Clustering <ul><li>For example, we might have the following data: </li></ul><ul><li>Where the axes are two dimensions and shape is a third, nominal attribute. </li></ul>
  46. 46. Clustering <ul><li>A clustering algorithm might find three clusters: </li></ul><ul><li>Even though there are some squares and circles mixed together. </li></ul>
  47. 47. Outliers Cluster 1 Cluster 2 Outliers
  48. 48. What is a natural grouping among these objects? School Employees Tatkare’s Family Males Females Clustering is subjective
  49. 49. What is Similarity? The quality or state of being similar; likeness; resemblance; as, a similarity of features. Similarity is hard to define, but… “ We know it when we see it ” The real meaning of similarity is a philosophical question. We will take a more pragmatic approach. Webster's Dictionary
  50. 50. Clustering Problem <ul><li>Given a database D={t 1 ,t 2 ,…,t n } of tuples and an integer value k, the Clustering Problem is to define a mapping f:D  {1,..,k} where each t i is assigned to one cluster K j , 1<=j<=k. </li></ul><ul><li>A Cluster , K j , contains precisely those tuples mapped to it. </li></ul><ul><li>Unlike classification problem, clusters are not known a priori. </li></ul>
  51. 51. Applications <ul><li>Marketing: Discover consumer groups based on their purchasing habits </li></ul><ul><li>City Planning: Identify groups of buildings by type, value, location </li></ul>
  52. 52. Applications <ul><li>Image Processing: Identify clusters of similar images (eg horses) </li></ul><ul><li>Biological: Discover groups of plants/animals with similar properties </li></ul>
  53. 53. Applications <ul><li>Given: </li></ul><ul><ul><li>A source of textual documents </li></ul></ul><ul><ul><li>Similarity measure </li></ul></ul><ul><ul><ul><li>e.g., how many words are common in these documents </li></ul></ul></ul>Clustering System Similarity measure Documents source Doc Doc Doc Doc Doc Doc Doc Doc Doc Doc <ul><li>Find: </li></ul><ul><ul><li>Several clusters of documents that are relevant to each other </li></ul></ul>
  54. 54. Association Rules <ul><li>A common application </li></ul><ul><li>is market basket </li></ul><ul><li>analysis which </li></ul><ul><li>(1) items are frequently </li></ul><ul><li>sold together at a </li></ul><ul><li>supermarket </li></ul><ul><li>(2) arranging items on </li></ul><ul><li>shelves which items </li></ul><ul><li>should be promoted </li></ul><ul><li>together </li></ul>
  55. 55. Association Rule Discovery
  56. 56. Association Rule Discovery <ul><li>Given a set of records each of which contain some number of items from a given collection; </li></ul><ul><ul><li>Produce dependency rules which will predict occurrence of an item based on occurrences of other items. </li></ul></ul>Rules Discovered: {Milk} --> {Coke} {Diaper, Milk} --> {Beer}
  57. 57. <ul><li>Market basket: </li></ul><ul><li>Rule form: “ Body  ead [support, </li></ul><ul><li>confidence] ” . </li></ul><ul><li>buys(X, `beer')  buys(X, “snacks') </li></ul><ul><li>[1%, 60%] </li></ul><ul><li>(a) If a customer X purchased `beer', </li></ul><ul><li>60% of them purchased `snacks' </li></ul><ul><li>(b) 1% of all transactions contain the </li></ul><ul><li>items `beer' and `snacks‘ together </li></ul>Association Rule Discovery
  58. 58. A Weka bird is a strong brown bird which is native to New Zealand and grows to be about the same size as a chicken. The Weka was once fairly common on the North and South Islands of New Zealand but over the years has heavily declined on the North Island due to the major damage of their habitats.
  59. 59. <ul><li>Three graphical user interfaces </li></ul><ul><ul><li>“ The Explorer” (exploratory data analysis) </li></ul></ul><ul><ul><li>“ The Experimenter” (experimental environment) </li></ul></ul><ul><ul><li>“ The KnowledgeFlow” (new process model inspired interface) </li></ul></ul>WEKA is available at http://
  60. 60. <ul><li>Witten, Ian and Eibe Frank, Data Mining: Practical Machine Learning Tools and Techniques, Second Edition, Morgan Kaufmann, 2005 </li></ul><ul><li>Dunham, Margaret H, Data Mining: Introductory and Advanced Topics, Prentice Hall, 2003 </li></ul>References
  61. 61. <ul><li>‘ dbmsnotes’ - </li></ul><ul><li>http:// / </li></ul>References: Yahoo Group
  62. 62. THANKS!!