Slides - Zhangxi Lin's homepage

789 views
688 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
789
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Slides - Zhangxi Lin's homepage

  1. 1. Zhangxi Lin ISQS 3358 Texas Tech University
  2. 2. <ul><li>Define data mining and list its objectives and benefits </li></ul><ul><li>Understand different purposes and applications of data mining </li></ul><ul><li>Understand different methods of data mining, especially clustering and decision tree models </li></ul><ul><li>Build expertise in use of some data mining software </li></ul>
  3. 3. <ul><li>Learn the process of data mining projects </li></ul><ul><li>Understand data mining pitfalls and myths </li></ul><ul><li>Define text mining and its objectives and benefits </li></ul><ul><li>Appreciate use of text mining in business applications </li></ul><ul><li>Define Web mining and its objectives and benefits </li></ul>
  4. 4. Case 1: Credit Card Promotion <ul><li>Credit card companies periodically send promotion offers, e.g. life insurance promotion, to some potential customers. </li></ul><ul><ul><li>Assume: </li></ul></ul><ul><ul><ul><li>Each promotion letter costs $0.20 </li></ul></ul></ul><ul><ul><ul><li>The profit from each promotion acceptance is $10 </li></ul></ul></ul><ul><ul><ul><li>Overall response rate is 1% </li></ul></ul></ul><ul><ul><li>Question: </li></ul></ul><ul><ul><ul><li>Sending the offer to unselected population will result in the expected average profit $10 * 1% - $0.2 * 99% = -$0.098 ---- a loss. How to send the promotion offers to the right customers in order to make profit? </li></ul></ul></ul><ul><ul><ul><li>How to maximize the profit by applying a proper set of selection rules? </li></ul></ul></ul>ISQS 6347, Data & Text Mining
  5. 5. Case 2: Customer Segmentation <ul><li>The data is used to segment the customers for sell promotion </li></ul><ul><li>Three products: DVD, game, a drink for adult </li></ul><ul><li>Problems </li></ul><ul><ul><li>How to segment the customers into two clusters </li></ul></ul><ul><ul><li>Is two clusters good enough? Why not three clusters </li></ul></ul>Data & Text Mining ID Name Gender Age Occupation C001 X M 15 Student C002 Y F 30 Staff C003 Z M 18 Student C004 A F 45 Staff C005 B M 30 Staff C006 C F 25 Student
  6. 6. Case 3: Association Rule Mining <ul><li>Given a set of transactions, find rules that will predict the occurrence of an item based on the occurrences of other items in the transaction </li></ul>Data & Text Mining Market-Basket transactions Example of Association Rules {Diaper}  {Beer}, {Milk, Bread}  {Eggs,Coke}, {Beer, Bread}  {Milk}, Implication means co-occurrence, not causality!
  7. 7. <ul><li>Data mining (DM) </li></ul><ul><li>A process that uses statistical, mathematical, artificial intelligence and machine-learning techniques to extract and identify useful information and subsequent knowledge from large databases </li></ul>
  8. 8. Knowledge discovery in databases (KDD ) <ul><li>A comprehensive process of using data mining methods to find useful information and patterns in data </li></ul>
  9. 9. <ul><li>Major characteristics and objectives of data mining </li></ul><ul><ul><li>Data are often buried deep within very large databases, which sometimes contain data from several years; sometimes the data are cleansed and consolidated in a data warehouse </li></ul></ul><ul><ul><li>The data mining environment is usually client/server architecture or a Web-based architecture </li></ul></ul>
  10. 10. <ul><li>Major characteristics and objectives of data mining </li></ul><ul><ul><li>Sophisticated new tools help to remove the information ore buried in corporate files or archival public records; finding it involves massaging and synchronizing the data to get the right results. </li></ul></ul><ul><ul><li>The miner is often an end user, empowered by data drills and other power query tools to ask ad hoc questions and obtain answers quickly, with little or no programming skill </li></ul></ul>
  11. 11. <ul><li>Major characteristics and objectives of data mining </li></ul><ul><ul><li>Striking it rich often involves finding an unexpected result and requires end users to think creatively </li></ul></ul><ul><ul><li>Data mining tools are readily combined with spreadsheets and other software development tools; the mined data can be analyzed and processed quickly and easily </li></ul></ul><ul><ul><li>Parallel processing is sometimes used because of the large amounts of data and massive search efforts </li></ul></ul>
  12. 12. <ul><li>How data mining works </li></ul><ul><ul><li>Data mining tools find patterns in data and may even infer rules from them </li></ul></ul><ul><ul><li>Three methods are used to identify patterns in data: </li></ul></ul><ul><ul><ul><li>Simple models </li></ul></ul></ul><ul><ul><ul><li>Intermediate models </li></ul></ul></ul><ul><ul><ul><li>Complex models </li></ul></ul></ul>
  13. 13. <ul><li>Classification </li></ul><ul><li>Supervised induction used to analyze the historical data stored in a database and to automatically generate a model that can predict future behavior </li></ul><ul><li>Common tools used for classification are: </li></ul><ul><ul><li>Neural networks </li></ul></ul><ul><ul><li>Decision trees </li></ul></ul><ul><ul><li>If-then-else rules </li></ul></ul>
  14. 14. <ul><li>Clustering </li></ul><ul><li>Partitioning a database into segments in which the members of a segment share similar qualities </li></ul><ul><li>Association </li></ul><ul><li>A category of data mining algorithm that establishes relationships about items that occur together in a given record </li></ul>
  15. 15. <ul><li>Sequence discovery </li></ul><ul><li>The identification of associations over time </li></ul><ul><li>Visualization can be used in conjunction with data mining to gain a clearer understanding of many underlying relationships </li></ul>
  16. 16. <ul><li>Regression is a well-known statistical technique that is used to map data to a prediction value </li></ul><ul><li>Forecasting estimates future values based on patterns within large sets of data </li></ul>
  17. 17. <ul><li>Marketing </li></ul><ul><li>Banking </li></ul><ul><li>Retailing and sales </li></ul><ul><li>Manufacturing and production </li></ul><ul><li>Brokerage and securities trading </li></ul><ul><li>Insurance </li></ul><ul><li>Computer hardware and software </li></ul><ul><li>Government and defense </li></ul><ul><li>Airlines </li></ul><ul><li>Health care </li></ul><ul><li>Broadcasting </li></ul><ul><li>Police </li></ul><ul><li>Homeland security </li></ul>Data mining applications
  18. 18. ISQS 6347, Data & Text Mining 20% 80%
  19. 19. <ul><li>Data mining tools and techniques can be classified based on the structure of the data and the algorithms used: </li></ul><ul><ul><li>Statistical methods </li></ul></ul><ul><ul><li>Decision trees </li></ul></ul><ul><ul><li>Defined as a root followed by internal nodes. Each node (including root) is labeled with a question and arcs associated with each node cover all possible responses </li></ul></ul>
  20. 20. <ul><li>Data mining tools and techniques can be classified based on the structure of the data and the algorithms used: </li></ul><ul><ul><li>Case-based reasoning </li></ul></ul><ul><ul><li>Neural computing </li></ul></ul><ul><ul><li>Intelligent agents </li></ul></ul><ul><ul><li>Genetic algorithms </li></ul></ul><ul><ul><li>Other tools </li></ul></ul><ul><ul><ul><li>Rule induction </li></ul></ul></ul><ul><ul><ul><li>Data visualization </li></ul></ul></ul>
  21. 21. <ul><li>A general algorithm for building a decision tree: </li></ul><ul><ul><li>Create a root node and select a splitting attribute. </li></ul></ul><ul><ul><li>Add a branch to the root node for each split candidate value and label </li></ul></ul><ul><ul><li>Take the following iterative steps: </li></ul></ul><ul><ul><ul><li>Classify data by applying the split value. </li></ul></ul></ul><ul><ul><ul><li>If a stopping point is reached, then create leaf node and label it. Otherwise, build another subtree </li></ul></ul></ul>
  22. 22. <ul><li>Gini index </li></ul><ul><li>Used in economics to measure the diversity of the population. The same concept can be used to determine the ‘purity’ of a specific class as a result of a decision to branch along a particular attribute/variable </li></ul>
  23. 23. <ul><li>Gini Index for a given node t : </li></ul><ul><ul><ul><li>(NOTE: p( j | t) is the relative frequency of class j at node t). </li></ul></ul></ul><ul><ul><li>Maximum (1 - 1/n c ) when records are equally distributed among all classes, implying least interesting information </li></ul></ul><ul><ul><li>Minimum (0.0) when all records belong to one class, implying most interesting information </li></ul></ul>ISQS 6347, Data & Text Mining
  24. 24. ISQS 6347, Data & Text Mining P(C1) = 0/6 = 0 P(C2) = 6/6 = 1 Gini = 1 – P(C1) 2 – P(C2) 2 = 1 – 0 – 1 = 0 P(C1) = 1/6 P(C2) = 5/6 Gini = 1 – (1/6) 2 – (5/6) 2 = 0.278 P(C1) = 2/6 P(C2) = 4/6 Gini = 1 – (2/6) 2 – (4/6) 2 = 0.444
  25. 25. <ul><li>The ID3 ( Iterative Dichotomizer 3) algorithm decision tree approach </li></ul><ul><ul><li>Entropy </li></ul></ul><ul><ul><li>Measures the extent of uncertainty or randomness in a data set. If all the data in a subset belong to just one class, then there is no uncertainty or randomness in that dataset, therefore the entropy is zero </li></ul></ul>
  26. 26. <ul><li>Collection of data objects and their attributes (variables) </li></ul><ul><li>An attribute is a property or characteristic of an object </li></ul><ul><ul><li>Examples: eye color of a person, temperature, etc. </li></ul></ul><ul><ul><li>Attribute is also known as variable, field, characteristic, or feature </li></ul></ul><ul><li>A collection of attributes describe an object </li></ul><ul><ul><li>Object is also known as record, point, case, sample, entity, or instance </li></ul></ul>ISQS 6347, Data & Text Mining Attributes (Variables) Objects
  27. 27. ISQS 6347, Data & Text Mining
  28. 28. ISQS 6347, Data & Text Mining Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Splitting Attributes Training Data Model: Decision Tree categorical categorical continuous class
  29. 29. ISQS 6347, Data & Text Mining categorical categorical continuous class MarSt Refund TaxInc YES NO NO Yes No Married Single, Divorced < 80K > 80K There could be more than one tree that fits the same data! NO
  30. 30. ISQS 6347, Data & Text Mining Decision Tree
  31. 31. ISQS 6347, Data & Text Mining Test Data Start from the root of tree. Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K
  32. 32. ISQS 6347, Data & Text Mining Test Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K
  33. 33. ISQS 6347, Data & Text Mining Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Test Data
  34. 34. ISQS 6347, Data & Text Mining Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Test Data
  35. 35. ISQS 6347, Data & Text Mining Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Test Data
  36. 36. ISQS 6347, Data & Text Mining Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Test Data Assign Cheat to “No”
  37. 37. ISQS 6347, Data & Text Mining Decision Tree
  38. 38. ISQS 6347, Data & Text Mining Actual Accept Actual Reject Computed Accept Computed Reject True Positive (TP) a True Negative (TN) d False Positive (FP) c False Negative (FN) b Accuracy rate = a / (a + c), Coverage rate = a / (a + b) Lift = Accuracy rate / [(a + b) / (a + b + c + d)] a + b c + d a + c b + d
  39. 39. <ul><li>Cluster analysis for data mining </li></ul><ul><ul><li>Cluster analysis is an exploratory data analysis tool for solving classification problems </li></ul></ul><ul><ul><li>The object is to sort cases into groups so that the degree of association is strong between members of the same cluster and weak between members of different clusters </li></ul></ul>
  40. 40. <ul><li>Cluster analysis results may be used to: </li></ul><ul><ul><li>Help identify a classification scheme </li></ul></ul><ul><ul><li>Suggest statistical models to describe populations </li></ul></ul><ul><ul><li>Indicate rules for assigning new cases to classes for identification, targeting, and diagnostic purposes </li></ul></ul><ul><ul><li>Provide measures of definition, size, and change in what were previously broad concepts </li></ul></ul><ul><ul><li>Find typical cases to represent classes </li></ul></ul>
  41. 41. <ul><li>Cluster analysis methods </li></ul><ul><ul><li>Statistical methods </li></ul></ul><ul><ul><li>Optimal methods </li></ul></ul><ul><ul><li>Neural networks </li></ul></ul><ul><ul><li>Fuzzy logic </li></ul></ul><ul><ul><li>Genetic algorithms </li></ul></ul><ul><li>Each of these methods generally works with one of two general method classes: </li></ul><ul><ul><li>Divisive </li></ul></ul><ul><ul><li>Agglomerative </li></ul></ul>
  42. 42. <ul><li>Hierarchical clustering method and example </li></ul><ul><ul><li>Decide which data to record from the items </li></ul></ul><ul><ul><li>Calculate the distances between all initial clusters. Store the results in a distance matrix </li></ul></ul><ul><ul><li>Search through the distance matrix and find the two most similar clusters </li></ul></ul><ul><ul><li>Fuse those two clusters together to produce a cluster that has at least two items </li></ul></ul><ul><ul><li>Calculate the distances between this new cluster and all the other clusters </li></ul></ul><ul><ul><li>Repeat steps 3 to 5 until you have reached the prespecified maximum number of clusters </li></ul></ul>
  43. 43. <ul><li>Classes of data mining tools and techniques as they relate to information and business intelligence (BI) technologies </li></ul><ul><ul><li>Mathematical and statistical analysis packages </li></ul></ul><ul><ul><li>Personalization tools for Web-based marketing </li></ul></ul><ul><ul><li>Analytics built into marketing platforms </li></ul></ul><ul><ul><li>Advanced CRM tools </li></ul></ul><ul><ul><li>Analytics added to other vertical industry-specific platforms </li></ul></ul><ul><ul><li>Analytics added to database tools (e.g., OLAP) </li></ul></ul><ul><ul><li>Standalone data mining tools </li></ul></ul>
  44. 45. What Is Text Mining? <ul><ul><li>Text mining is a process that employs a set of algorithms for converting unstructured text into structured data objects and the quantitative methods used to analyze these data objects. </li></ul></ul>
  45. 46. Text Mining Case: Federalist papers <ul><li>Alexander Hamilton, James Madison, and John Jay wrote a series of essays in 1787 and 1788 to try to convince the citizens of the state of New York to ratify the new constitution of the United States. These essays are collectively called The Federalist Papers. Copies of the papers in a variety of formats can be found at </li></ul><ul><ul><li>http:// www.yale.edu/lawweb/avalon/federal/fed.htm , or </li></ul></ul><ul><ul><li>http://www.constitution.org/fed/federa00.htm . </li></ul></ul><ul><li>Of the 85 essays, 51 are attributed to Hamilton, 15 to Madison, 5 to Jay, and 3 to Hamilton and Madison jointly. The 11 remaining essays can be attributed only to Hamilton or Madison. Mosteller and Wallace (1964) used Bayesian statistical techniques to provide evidence that Madison wrote all 11 of the essays of unknown authorship. (The essays in question are numbers 49, 50, 51, 52, 53, 54, 55, 56, 57, 62, and 63.) </li></ul><ul><li>Problem: Uniquely identify an author based on the distribution of words in a document. </li></ul>
  46. 47. A simple text mining example <ul><li>A tiny case - 9 documents </li></ul><ul><ul><li>deposit the cash and check in the bank - Fin </li></ul></ul><ul><ul><li>the river boat is on the bank - Riv </li></ul></ul><ul><ul><li>borrow based on credit - Fin </li></ul></ul><ul><ul><li>river boat floats up the river - Riv </li></ul></ul><ul><ul><li>boat is by the dock near the bank - Riv </li></ul></ul><ul><ul><li>with credit, I can borrow cash from the bank - Fin </li></ul></ul><ul><ul><li>boat floats by dock near the river bank - Riv </li></ul></ul><ul><ul><li>check the parade route to see the floats - Par </li></ul></ul><ul><ul><li>along the parade route - Par </li></ul></ul>
  47. 48. <ul><li>Text mining helps organizations: </li></ul><ul><ul><li>Find the “hidden” content of documents, including additional useful relationships </li></ul></ul><ul><ul><li>Relate documents across previous unnoticed divisions </li></ul></ul><ul><ul><li>Group documents by common themes </li></ul></ul>
  48. 49. <ul><li>Applications of text mining </li></ul><ul><ul><li>Automatic detection of e-mail spam or phishing through analysis of the document content </li></ul></ul><ul><ul><li>Automatic processing of messages or e-mails to route a message to the most appropriate party to process that message </li></ul></ul><ul><ul><li>Analysis of warranty claims, help desk calls/reports, and so on to identify the most common problems and relevant responses </li></ul></ul>
  49. 50. <ul><li>Applications of text mining </li></ul><ul><ul><li>Analysis of related scientific publications in journals to create an automated summary view of a particular discipline </li></ul></ul><ul><ul><li>Creation of a “relationship view” of a document collection </li></ul></ul><ul><ul><li>Qualitative analysis of documents to detect deception </li></ul></ul>
  50. 51. <ul><li>How to mine text </li></ul><ul><ul><li>Eliminate commonly used words (stop-words) </li></ul></ul><ul><ul><li>Replace words with their stems or roots (stemming algorithms) </li></ul></ul><ul><ul><li>Consider synonyms and phrases </li></ul></ul><ul><ul><li>Calculate the weights of the remaining terms </li></ul></ul>
  51. 52. Example <ul><li>Coca-Cola announced earnings on Saturday, Dec. 12, 2000. Profits were up by 3.1% as of 12/12/1999. </li></ul><ul><li>coca-cola </li></ul><ul><li>+ announce </li></ul><ul><li>earnings </li></ul><ul><li>on </li></ul><ul><li>Saturday </li></ul><ul><li>dec. </li></ul><ul><li>12 </li></ul><ul><li>2000 </li></ul><ul><li>+ profit </li></ul><ul><li>+ be </li></ul><ul><li>up </li></ul><ul><li>3.1% </li></ul><ul><li>as of </li></ul><ul><li>2000-12-12 </li></ul><ul><li>1999-12-12 </li></ul>
  52. 53. <ul><li>Web mining </li></ul><ul><li>The discovery and analysis of interesting and useful information from the Web, about the Web, and usually through Web-based tools </li></ul>
  53. 55. <ul><li>Web content mining </li></ul><ul><li>The extraction of useful information from Web pages </li></ul><ul><li>Web structure mining </li></ul><ul><li>The development of useful information from the links included in the Web documents </li></ul><ul><li>Web usage mining </li></ul><ul><li>The extraction of useful information from the data being generated through webpage visits, transaction, etc. </li></ul>
  54. 56. <ul><li>Uses for Web mining: </li></ul><ul><ul><li>Determine the lifetime value of clients </li></ul></ul><ul><ul><li>Design cross-marketing strategies across products </li></ul></ul><ul><ul><li>Evaluate promotional campaigns </li></ul></ul><ul><ul><li>Target electronic ads and coupons at user groups </li></ul></ul><ul><ul><li>Predict user behavior </li></ul></ul><ul><ul><li>Present dynamic information to users </li></ul></ul>
  55. 58. Banners Landing page Sign up Target page Click Click Click BANNERAD ABANDON PROPBUY Buy Exit Exit Exit Exit Depth of conversion Sign up First time purchase Repeated purchase Data Data Data Data
  56. 59. <ul><li>How to improve the effectiveness of banner advertising? </li></ul><ul><ul><li>Understand the context: </li></ul></ul><ul><ul><ul><li>Availability of the information: click-through flow, user profile, etc. </li></ul></ul></ul><ul><ul><ul><li>Multiple ads – which one should be used? </li></ul></ul></ul><ul><ul><li>Data collection </li></ul></ul><ul><ul><li>Data mining </li></ul></ul><ul><ul><li>Model evaluation </li></ul></ul>
  57. 60. <ul><li>Model can be built using </li></ul><ul><ul><li>Web log data </li></ul></ul><ul><ul><li>Registration data </li></ul></ul><ul><ul><li>Vendor data (may not be required) </li></ul></ul><ul><li>One model with indicator for banner ad/vendor selected </li></ul><ul><li>Multiple models, one for each vendor </li></ul><ul><ul><li>Overlapping data if page sequences are included, because “did not click” entries will have common elements in all models </li></ul></ul><ul><li>Model scores the propensity to click on a vendor’s banner ad </li></ul>
  58. 61. <ul><li>In the case there is only one slot for one of two ads, which one is the best decision: </li></ul><ul><ul><li>Selectively place an ad from the two choices </li></ul></ul><ul><ul><li>Randomly place one of the ads </li></ul></ul><ul><ul><li>Place both with two slots, or time-sharing alternatively </li></ul></ul><ul><ul><li>Place nothing when the likelihood of the click-through is low, because of the possible negative effect. </li></ul></ul>
  59. 62. SAS Enterprise Miner 4.3 <ul><li>Basic </li></ul><ul><ul><li>How to use the application main menu </li></ul></ul><ul><ul><li>Using the pop-up menus </li></ul></ul><ul><ul><li>Enterprise Miner documentation </li></ul></ul><ul><ul><li>Project – Diagram </li></ul></ul><ul><li>The SEMMA methodology </li></ul><ul><ul><li>Sample </li></ul></ul><ul><ul><li>Explore </li></ul></ul><ul><ul><li>Modify </li></ul></ul><ul><ul><li>Model </li></ul></ul><ul><ul><li>Assess </li></ul></ul>ISQS 6347, Data & Text Mining
  60. 63. Decision Tree Example (pp147-151) Low 3 68 High 2 43 Low 4 32 High 0 23 High 5 20 High 1 17 Loan risk Pattern# Income
  61. 64. MBA Admission Decision Problem ? 65 4.00 490 ? 80 2.85 590 ? 60 3.00 540 Yes 75 3.50 640 No 45 3.85 400 Yes 80 3.50 590 Yes 90 3.25 700 No 80 2.95 450 Yes 75 3.50 600 No 70 3.50 580 No 35 2.75 650 Decision Quantitative GAMT Score (percentile) GPA GMAT

×