Published on

Published in: Education
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Mine for: Selection Aggregation Abstraction Visualization Transformation/Conversion Statistical Analysis “Cleaning”
  • Talk

    1. 1. Department of Computer Science University of Wisconsin – Eau Claire Eau Claire, WI 54701 [email_address] 715-836-2526 Introduction to Data Mining Michael R. Wick Professor and Chair
    2. 2. Acknowledgements <ul><li>Some of the material used in this talk is drawn from: </li></ul><ul><ul><li>Dr. Jiawei Han at University of Illinois at Urbana Champaign </li></ul></ul><ul><ul><li>Dr. Bhavani Thuraisingham (MITRE Corp. and UT Dallas) </li></ul></ul><ul><ul><li>Dr. Chris Clifton, Indiana Center for Database Systems, Purdue University </li></ul></ul>
    3. 3. Road Map <ul><li>Definition and Need </li></ul><ul><li>Applications </li></ul><ul><li>Process </li></ul><ul><li>Types </li></ul><ul><li>Example: The Apriori Algorithm </li></ul><ul><li>State of Practice </li></ul><ul><li>Related Techniques </li></ul><ul><li>Data Preprocessing </li></ul>
    4. 4. What Is Data Mining? <ul><li>Data mining (knowledge discovery from data) </li></ul><ul><ul><li>Extraction of interesting ( non-trivial, implicit, previously unknown and potentially useful) patterns or knowledge from huge amount of data </li></ul></ul><ul><ul><li>Data mining: a misnomer </li></ul></ul><ul><li>Alternative names </li></ul><ul><ul><li>Knowledge discovery (mining) in databases (KDD), knowledge extraction, data/pattern analysis, data archeology, data dredging, information harvesting, business intelligence, etc. </li></ul></ul><ul><li>Watch out: Is everything “data mining”? </li></ul><ul><ul><li>(Deductive) query processing. </li></ul></ul><ul><ul><li>Expert systems or small learning programs </li></ul></ul>
    5. 5. What is Data Mining? Real Example from the NBA <ul><li>Play-by-play information recorded by teams </li></ul><ul><ul><li>Who is on the court </li></ul></ul><ul><ul><li>Who shoots </li></ul></ul><ul><ul><li>Results </li></ul></ul><ul><li>Coaches want to know what works best </li></ul><ul><ul><li>Plays that work well against a given team </li></ul></ul><ul><ul><li>Good/bad player matchups </li></ul></ul><ul><li>Advanced Scout (from IBM Research) is a data mining tool to answer these questions </li></ul> Starks+Houston+Ward playing
    6. 6. Necessity for Data Mining <ul><li>Large amounts of current and historical data being stored </li></ul><ul><ul><li>Only small portion (~5-10%) of collected data is analyzed </li></ul></ul><ul><ul><li>Data that may never be analyzed is collected in the fear that something that may prove important will be missed </li></ul></ul><ul><li>As databases grow larger, decision-making from the data is not possible; need knowledge derived from the stored data </li></ul><ul><li>Data sources </li></ul><ul><ul><li>Health-related services, e.g., benefits, medical analyses </li></ul></ul><ul><ul><li>Commercial, e.g., marketing and sales </li></ul></ul><ul><ul><li>Financial </li></ul></ul><ul><ul><li>Scientific, e.g., NASA, Genome </li></ul></ul><ul><ul><li>DOD and Intelligence </li></ul></ul><ul><li>Desired analyses </li></ul><ul><ul><li>Support for planning (historical supply and demand trends) </li></ul></ul><ul><ul><li>Yield management (scanning airline seat reservation data to maximize yield per seat) </li></ul></ul><ul><ul><li>System performance (detect abnormal behavior in a system) </li></ul></ul><ul><ul><li>Mature database analysis (clean up the data sources) </li></ul></ul>
    7. 7. Necessity Is the Mother of Invention <ul><li>Data explosion problem </li></ul><ul><ul><li>Automated data collection tools and mature database technology lead to tremendous amounts of data accumulated and/or to be analyzed in databases, data warehouses, and other information repositories </li></ul></ul><ul><li>We are drowning in data, but starving for knowledge! </li></ul><ul><li>Solution: Data warehousing and data mining </li></ul><ul><ul><li>Data warehousing and on-line analytical processing </li></ul></ul><ul><ul><li>Mining interesting knowledge (rules, regularities, patterns, constraints) from data in large databases </li></ul></ul>
    8. 8. Potential Applications <ul><li>Data analysis and decision support </li></ul><ul><ul><li>Market analysis and management </li></ul></ul><ul><ul><ul><li>Target marketing, customer relationship management (CRM), market basket analysis, cross selling, market segmentation </li></ul></ul></ul><ul><ul><li>Risk analysis and management </li></ul></ul><ul><ul><ul><li>Forecasting, customer retention, improved underwriting, quality control, competitive analysis </li></ul></ul></ul><ul><ul><li>Fraud detection </li></ul></ul><ul><ul><ul><li>Finding outliers in credit card purchases </li></ul></ul></ul><ul><li>Other Applications </li></ul><ul><ul><li>Text mining (news group, email, documents) and Web mining </li></ul></ul><ul><ul><li>Stream data mining </li></ul></ul><ul><ul><li>DNA and bio-data analysis </li></ul></ul>
    9. 9. Data Mining: Confluence of Multiple Disciplines Data Mining Database Systems Statistics Other Disciplines Algorithm Machine Learning Visualization
    10. 10. Knowledge Discovery in Databases: Process adapted from: U. Fayyad, et al. (1995), “From Knowledge Discovery to Data Mining: An Overview,” Advances in Knowledge Discovery and Data Mining, U. Fayyad et al. (Eds.), AAAI/MIT Press Knowledge Data Target Data Selection Preprocessed Data Patterns Data Mining Interpretation/ Evaluation Preprocessing
    11. 11. Steps of a KDD Process <ul><li>Learning the application domain </li></ul><ul><ul><li>relevant prior knowledge and goals of application </li></ul></ul><ul><li>Creating a target data set: data selection </li></ul><ul><li>Data cleaning : (may take 60% of effort!) </li></ul><ul><li>Data reduction and transformation </li></ul><ul><ul><li>Find useful features, dimensionality/variable reduction, invariant representation. </li></ul></ul><ul><li>Choosing methods of data mining </li></ul><ul><ul><li>summarization, classification, regression, association, clustering. </li></ul></ul><ul><li>Choosing the mining algorithm(s) </li></ul><ul><li>Data mining: search for patterns of interest </li></ul><ul><li>Pattern evaluation and knowledge presentation </li></ul><ul><ul><li>visualization, transformation, removing redundant patterns, etc. </li></ul></ul><ul><li>Use of discovered knowledge </li></ul>
    12. 12. Data Mining and Business Intelligence Increasing potential to support business decisions End User Business Analyst Data Analyst DBA Making Decisions Data Presentation Visualization Techniques Data Mining Information Discovery Data Exploration OLAP, MDA Statistical Analysis, Querying and Reporting Data Warehouses / Data Marts Data Sources Paper, Files, Information Providers, Database Systems, OLTP
    13. 13. Multiple Perspectives in Data Mining <ul><li>Data to be mined </li></ul><ul><ul><li>Relational, data warehouse, transactional, stream, object-oriented/relational, active, spatial, time-series, text, multi-media, heterogeneous, legacy, WWW </li></ul></ul><ul><li>Knowledge to be mined </li></ul><ul><ul><li>Characterization, discrimination, association, classification, clustering, trend/deviation, outlier analysis, etc. </li></ul></ul><ul><ul><li>Multiple/integrated functions and mining at multiple levels </li></ul></ul><ul><li>Techniques utilized </li></ul><ul><ul><li>Database-oriented, data warehouse (OLAP), machine learning, statistics, visualization, etc. </li></ul></ul><ul><li>Applications adapted </li></ul><ul><ul><li>Retail, telecommunication, banking, fraud analysis, bio-data mining, stock market analysis, Web mining, etc. </li></ul></ul>
    14. 14. Ingredients of an Effective KDD Process Background Knowledge Goals for Learning Knowledge Base Database(s) Plan for Learning Discover Knowledge Determine Knowledge Relevancy Evolve Knowledge/ Data Generate and Test Hypotheses Visualization and Human Computer Interaction Discovery Algorithms “ In order to discover anything, you must be looking for something.” Murphy’s 1 st Law of Serendipity
    15. 15. What Can Data Mining Do? <ul><li>Clustering </li></ul><ul><ul><li>Identify previously unknown groups </li></ul></ul><ul><li>Classification </li></ul><ul><ul><li>Give operational definitions to categories </li></ul></ul><ul><li>Association </li></ul><ul><ul><li>Find Association rules </li></ul></ul><ul><li>Many others… </li></ul>
    16. 16. Clustering <ul><li>Cluster: a collection of data objects </li></ul><ul><ul><li>Similar to one another within the same cluster </li></ul></ul><ul><ul><li>Dissimilar to the objects in other clusters </li></ul></ul><ul><li>Cluster analysis </li></ul><ul><ul><li>Grouping a set of data objects into clusters </li></ul></ul><ul><li>Clustering is unsupervised classification: no predefined classes </li></ul><ul><li>Typical applications </li></ul><ul><ul><li>As a stand-alone tool to get insight into data distribution </li></ul></ul><ul><ul><li>As a preprocessing step for other algorithms </li></ul></ul>
    17. 17. Some Clustering Approaches <ul><li>Iterative Distance-based Clustering </li></ul><ul><ul><li>Specify in advance the number of desired clusters ( k ) </li></ul></ul><ul><ul><li>K random points chosen as cluster centers </li></ul></ul><ul><ul><li>Instances assigned to closest center </li></ul></ul><ul><ul><li>Centroid (or mean) of all points in cluster is calculated </li></ul></ul><ul><ul><li>Repeat until clusters are stable </li></ul></ul><ul><li>Incremental Clustering </li></ul><ul><ul><li>Uses tree to represent clusters </li></ul></ul><ul><ul><li>Nodes represent clusters (or subclusters) </li></ul></ul><ul><ul><li>Instances added one by one and tree updated </li></ul></ul><ul><ul><li>Updating can involve simple placement of instance in cluster or re-clustering </li></ul></ul><ul><ul><li>Uses category utility function to determine if instance fits with each cluster </li></ul></ul><ul><ul><li>Can result in merging or splitting of existing clusters </li></ul></ul><ul><li>Category Utility </li></ul><ul><ul><li>Uses quadratic loss function of conditional probabilities </li></ul></ul><ul><ul><li>Does the addition of new instance help us better predict the value of attributes for other instances? </li></ul></ul>
    18. 18. General Applications of Clustering <ul><li>Pattern Recognition </li></ul><ul><li>Spatial Data Analysis </li></ul><ul><ul><li>create thematic maps in GIS by clustering feature spaces </li></ul></ul><ul><ul><li>detect spatial clusters and explain them in spatial data mining </li></ul></ul><ul><li>Image Processing </li></ul><ul><li>Economic Science (especially market research) </li></ul><ul><li>WWW </li></ul><ul><ul><li>Document classification </li></ul></ul><ul><ul><li>Cluster Weblog data to discover groups of similar access patterns </li></ul></ul>
    19. 19. Examples of Clustering Applications <ul><li>Marketing: Help marketers discover distinct groups in their customer bases, and then use this knowledge to develop targeted marketing programs </li></ul><ul><li>Land use: Identification of areas of similar land use in an earth observation database </li></ul><ul><li>Insurance: Identifying groups of motor insurance policy holders with a high average claim cost </li></ul><ul><li>City-planning: Identifying groups of houses according to their house type, value, and geographical location </li></ul><ul><li>Earth-quake studies: Observed earth quake epicenters should be clustered along continent faults </li></ul>
    20. 20. Classification (vs Prediction) <ul><li>Classification: </li></ul><ul><ul><li>predicts categorical class labels (discrete/nominal) </li></ul></ul><ul><ul><li>classifies data (constructs a model) based on the training set and the values (class labels) in a classifying attribute and uses it in classifying new data </li></ul></ul><ul><ul><li>Learns operational definition </li></ul></ul><ul><li>Prediction: </li></ul><ul><ul><li>models continuous-valued functions, i.e., predicts unknown or missing values </li></ul></ul><ul><li>Typical Applications </li></ul><ul><ul><li>credit approval </li></ul></ul><ul><ul><li>target marketing </li></ul></ul><ul><ul><li>medical diagnosis </li></ul></ul><ul><ul><li>treatment effectiveness analysis </li></ul></ul>
    21. 21. Classification—A Two-Step Process <ul><li>Model construction: describing a set of predetermined classes </li></ul><ul><ul><li>Each tuple/sample is assumed to belong to a predefined class, as determined by the class label attribute </li></ul></ul><ul><ul><li>The set of tuples used for model construction is training set </li></ul></ul><ul><ul><li>The model is represented as classification rules, decision trees, or mathematical formula </li></ul></ul><ul><li>Model usage: for classifying future or unknown objects </li></ul><ul><ul><li>Estimate accuracy of the model </li></ul></ul><ul><ul><ul><li>The known label of test sample is compared with the classified result from the model </li></ul></ul></ul><ul><ul><ul><li>Accuracy rate is the percentage of test set samples that are correctly classified by the model </li></ul></ul></ul><ul><ul><ul><li>Test set is independent of training set, otherwise over-fitting will occur </li></ul></ul></ul><ul><ul><li>If the accuracy is acceptable, use the model to classify data tuples whose class labels are not known </li></ul></ul>
    22. 22. Classification Process (1): Model Construction Classification Algorithms IF rank = ‘professor’ OR years > 6 THEN tenured = ‘yes’ Training Data Classifier (Model)
    23. 23. Classification Process (2): Use the Model in Prediction (Jeff, Professor, 4) Tenured? Classifier Testing Data Unseen Data
    24. 24. Classification Approaches <ul><li>Divide and Conquer </li></ul><ul><ul><li>Results in decision tree </li></ul></ul><ul><ul><li>Uses “information gain” function </li></ul></ul><ul><li>Covering </li></ul><ul><ul><ul><ul><li>- Select category for which to learn rule </li></ul></ul></ul></ul><ul><ul><li>- Add conditions on rule until “good enough” </li></ul></ul>
    25. 25. Association <ul><li>Association rule mining: </li></ul><ul><ul><li>Finding frequent patterns, associations, correlations, or causal structures among sets of items or objects in transaction databases, relational databases, and other information repositories. </li></ul></ul><ul><ul><li>Frequent pattern: pattern (set of items, sequence, etc.) that occurs frequently in a database [AIS93] </li></ul></ul><ul><li>Motivation: finding regularities in data </li></ul><ul><ul><li>What products were often purchased together? — Beer and diapers?! </li></ul></ul><ul><ul><li>What are the subsequent purchases after buying a PC? </li></ul></ul><ul><ul><li>What kinds of DNA are sensitive to this new drug? </li></ul></ul><ul><ul><li>Can we automatically classify web documents? </li></ul></ul>
    26. 26. Why Is Association Mining Important? <ul><li>Foundation for many essential data mining tasks </li></ul><ul><ul><li>Association, correlation, causality </li></ul></ul><ul><ul><li>Sequential patterns, temporal or cyclic association, partial periodicity, spatial and multimedia association </li></ul></ul><ul><ul><li>Associative classification, cluster analysis, iceberg cube, fascicles (semantic data compression) </li></ul></ul><ul><li>Broad applications </li></ul><ul><ul><li>Basket data analysis, cross-marketing, catalog design, sale campaign analysis </li></ul></ul><ul><ul><li>Web log (click stream) analysis, DNA sequence analysis, etc. </li></ul></ul>
    27. 27. Basic Concepts: Association Rules <ul><li>Itemset X={x 1 , …, x k } </li></ul><ul><li>Find all the rules X  Y with min confidence and support </li></ul><ul><ul><li>support, s , probability that a transaction contains X  Y </li></ul></ul><ul><ul><li>confidence, c, conditional probability that a transaction having X also contains Y . </li></ul></ul><ul><li>Let min_support = 50%, min_conf = 50%: </li></ul><ul><ul><li>A  C (50%, 66.7%) </li></ul></ul><ul><ul><li>C  A (50%, 100%) </li></ul></ul>B, E, F 40 A, D 30 A, C 20 A, B, C 10 Items bought Transaction-id Customer buys diaper Customer buys both Customer buys beer
    28. 28. Mining Association Rules: Example <ul><li>For rule A  C : </li></ul><ul><ul><li>support = support({ A }  { C }) = 50% </li></ul></ul><ul><ul><li>confidence = support({ A }  { C })/support({ A }) = 66.6% </li></ul></ul>Min. support 50% Min. confidence 50% B, E, F 40 A, D 30 A, C 20 A, B, C 10 Items bought Transaction-id 50% {A, C} 50% {C} 50% {B} 75% {A} Support Frequent pattern
    29. 29. Apriori: A Candidate Generation-and-test Approach <ul><li>Any subset of a frequent itemset must be frequent </li></ul><ul><ul><li>if {beer, diaper, nuts} is frequent, so is {beer, diaper} </li></ul></ul><ul><ul><li>Every transaction having {beer, diaper, nuts} also contains {beer, diaper} </li></ul></ul><ul><li>Apriori pruning principle : If there is any itemset which is infrequent, its superset should not be generated/tested! </li></ul><ul><li>Method: </li></ul><ul><ul><li>generate length (k+1) candidate itemsets from length k frequent itemsets, and </li></ul></ul><ul><ul><li>test the candidates against DB </li></ul></ul><ul><li>Performance studies show its efficiency and scalability </li></ul>
    30. 30. The Apriori Algorithm—A Mathematical Definition <ul><ul><ul><li>Let I = {a,b,c,…} be a set of all items in the domain </li></ul></ul></ul><ul><ul><ul><li>Let T = { S | S  I } be a set of all transaction records of item sets </li></ul></ul></ul><ul><ul><ul><li>Let support( S ) =  { A | A  T  S  A } | </li></ul></ul></ul><ul><ul><ul><li>Let L 1 = { { a } | a  I  support({ a })  minSupport } </li></ul></ul></ul><ul><ul><ul><li> k ( k > 1  L k -1   ) Let </li></ul></ul></ul><ul><ul><ul><ul><li>L k = { S i  S j | ( S i  L k -1 )  ( S j  L k -1 )  </li></ul></ul></ul></ul><ul><ul><ul><ul><li>( | S i – S j | = 1 )  ( | S j – S i | = 1)  </li></ul></ul></ul></ul><ul><ul><ul><ul><li>(  S [ (( S  S i  S j )  (| S | = k -1))  S  L k -1 ] )  </li></ul></ul></ul></ul><ul><ul><ul><ul><li>( support( S i  S j )  minSupport ) </li></ul></ul></ul></ul><ul><ul><ul><li>Then, the set of all frequent item sets is given by </li></ul></ul></ul><ul><ul><ul><li>L = L k </li></ul></ul></ul><ul><ul><ul><li>and the set of all association rules is given by </li></ul></ul></ul><ul><ul><ul><li>R = { A  C | A   (L k )  ( C = L k – A)  ( A   )  ( C   ) </li></ul></ul></ul><ul><ul><ul><li>support(L k ) / support( A )  minConfidence } </li></ul></ul></ul>
    31. 31. The Apriori Algorithm—An Example <ul><ul><li>Example: minSupport = 2 </li></ul></ul><ul><ul><ul><li>I= {Table Saw, Router, Kreg Jig, Sander, Drill Press} </li></ul></ul></ul><ul><ul><ul><li>T= { {Table Saw, Router, Drill Press}, </li></ul></ul></ul><ul><ul><ul><li>{ Router, Sander }, </li></ul></ul></ul><ul><ul><ul><li>{ Router, Kreg Jig }, </li></ul></ul></ul><ul><ul><ul><li>{Table Saw, Router, , Sander }, </li></ul></ul></ul><ul><ul><ul><li>{Table Saw, , Kreg Jig }, </li></ul></ul></ul><ul><ul><ul><li>{ Router, Kreg Jig }, </li></ul></ul></ul><ul><ul><ul><li>{Table Saw, , Kreg Jig }, </li></ul></ul></ul><ul><ul><ul><li>{Table Saw, Router, Kreg Jig, , Drill Press}, </li></ul></ul></ul><ul><ul><ul><li>{Table Saw, Router, Kreg Jig } } </li></ul></ul></ul><ul><ul><ul><li>L1 = { {T}, {R}, {K}, {S}, {D} } </li></ul></ul></ul><ul><ul><ul><li>L2 = { {R,T}, {K,T}, {D,T}, {K,R}, {R,S}, {D,R} } </li></ul></ul></ul><ul><ul><ul><li>L3 = { {K,R,T}, {D,R,T} } </li></ul></ul></ul><ul><ul><ul><li>L4 =  </li></ul></ul></ul><ul><ul><ul><li>Rules = ???? </li></ul></ul></ul>
    32. 32. The Apriori Algorithm <ul><li>Pseudo-code : </li></ul><ul><ul><ul><li>C k : Candidate itemset of size k </li></ul></ul></ul><ul><ul><ul><li>L k : frequent itemset of size k </li></ul></ul></ul><ul><ul><ul><li>L 1 = {frequent items}; </li></ul></ul></ul><ul><ul><ul><li>for ( k = 1; L k !=  ; k ++) do begin </li></ul></ul></ul><ul><ul><ul><li>C k+1 = candidates generated from L k ; </li></ul></ul></ul><ul><ul><ul><li>for each transaction t in database do </li></ul></ul></ul><ul><ul><ul><ul><li>increment the count of all candidates in C k+1 that are contained in t </li></ul></ul></ul></ul><ul><ul><ul><li>L k+1 = candidates in C k+1 with min_support </li></ul></ul></ul><ul><ul><ul><li>end </li></ul></ul></ul><ul><ul><ul><li>return  k L k ; </li></ul></ul></ul>
    33. 33. Important Details of Apriori <ul><li>How to generate candidates? </li></ul><ul><ul><li>Step 1: self-joining L k </li></ul></ul><ul><ul><li>Step 2: pruning </li></ul></ul><ul><li>How to count supports of candidates? </li></ul><ul><li>Example of Candidate-generation </li></ul><ul><ul><li>L 3 = { abc, abd, acd, ace, bcd } </li></ul></ul><ul><ul><li>Self-joining: L 3 *L 3 </li></ul></ul><ul><ul><ul><li>abcd from abc and abd </li></ul></ul></ul><ul><ul><ul><li>acde from acd and ace </li></ul></ul></ul><ul><ul><li>Pruning: </li></ul></ul><ul><ul><ul><li>acde is removed because ade is not in L 3 </li></ul></ul></ul><ul><ul><li>C 4 ={ abcd } </li></ul></ul>
    34. 34. State of Commercial/Research Practice <ul><li>Increasing use of data mining systems in financial community, marketing sectors, retailing </li></ul><ul><li>Still have major problems with large, dynamic sets of data (need better integration with the databases) </li></ul><ul><ul><li>Off-the-shelf data mining packages perform specialized learning on small subset of data </li></ul></ul><ul><li>Most research emphasizes machine learning; little emphasis on database side (especially text) </li></ul><ul><li>People achieving results are not likely to share knowledge </li></ul>
    35. 35. Related Techniques: OLAP On-Line Analytical Processing <ul><li>On-Line Analytical Processing tools provide the ability to pose statistical and summary queries interactively </li></ul><ul><ul><li>Traditional On-Line Transaction Processing (OLTP) databases may take minutes or even hours to answer these queries </li></ul></ul><ul><li>Advantages relative to data mining </li></ul><ul><ul><li>Can obtain a wider variety of results </li></ul></ul><ul><ul><li>Generally faster to obtain results </li></ul></ul><ul><li>Disadvantages relative to data mining </li></ul><ul><ul><li>User must “ask the right question” </li></ul></ul><ul><ul><li>Generally used to determine high-level statistical summaries, rather than specific relationships among instances </li></ul></ul>
    36. 36. Integration of Data Mining and Data Warehousing <ul><li>Data mining systems, DBMS, Data warehouse systems coupling </li></ul><ul><ul><li>No coupling, loose-coupling, semi-tight-coupling, tight-coupling </li></ul></ul><ul><li>On-line analytical mining data </li></ul><ul><ul><li>integration of mining and OLAP technologies </li></ul></ul><ul><li>Interactive mining multi-level knowledge </li></ul><ul><ul><li>Necessity of mining knowledge and patterns at different levels of abstraction by drilling/rolling, pivoting, slicing/dicing, etc. </li></ul></ul><ul><li>Integration of multiple mining functions </li></ul><ul><ul><li>Characterized classification, first clustering and then association </li></ul></ul>
    37. 37. Why Data Preprocessing? <ul><li>Data in the real world is dirty </li></ul><ul><ul><li>incomplete : lacking attribute values, lacking certain attributes of interest, or containing only aggregate data </li></ul></ul><ul><ul><ul><li>e.g., occupation=“” </li></ul></ul></ul><ul><ul><li>noisy : containing errors or outliers </li></ul></ul><ul><ul><ul><li>e.g., Salary=“-10” </li></ul></ul></ul><ul><ul><li>inconsistent : containing discrepancies in codes or names </li></ul></ul><ul><ul><ul><li>e.g., Age=“42” Birthday=“03/07/1997” </li></ul></ul></ul><ul><ul><ul><li>e.g., Was rating “1,2,3”, now rating “A, B, C” </li></ul></ul></ul><ul><ul><ul><li>e.g., discrepancy between duplicate records </li></ul></ul></ul>
    38. 38. Why Is Data Dirty? <ul><li>Incomplete data comes from </li></ul><ul><ul><li>n/a data value when collected </li></ul></ul><ul><ul><li>different consideration between the time when the data was collected and when it is analyzed. </li></ul></ul><ul><ul><li>human/hardware/software problems </li></ul></ul><ul><li>Noisy data comes from the process of data </li></ul><ul><ul><li>collection </li></ul></ul><ul><ul><li>entry </li></ul></ul><ul><ul><li>transmission </li></ul></ul><ul><li>Inconsistent data comes from </li></ul><ul><ul><li>Different data sources </li></ul></ul><ul><ul><li>Functional dependency violation </li></ul></ul>
    39. 39. Why Is Data Preprocessing Important? <ul><li>No quality data, no quality mining results! </li></ul><ul><ul><li>Quality decisions must be based on quality data </li></ul></ul><ul><ul><ul><li>e.g., duplicate or missing data may cause incorrect or even misleading statistics. </li></ul></ul></ul><ul><ul><li>Data warehouse needs consistent integration of quality data </li></ul></ul><ul><li>Data extraction, cleaning, and transformation comprises the majority of the work of building a data warehouse. —Bill Inmon (father of the data warehouse) </li></ul>
    40. 40. Major Tasks in Data Preprocessing <ul><li>Data cleaning </li></ul><ul><ul><li>Fill in missing values, smooth noisy data, identify or remove outliers, and resolve inconsistencies </li></ul></ul><ul><li>Data integration </li></ul><ul><ul><li>Integration of multiple databases, data cubes, or files </li></ul></ul><ul><li>Data transformation </li></ul><ul><ul><li>Normalization and aggregation </li></ul></ul><ul><li>Data reduction </li></ul><ul><ul><li>Obtains reduced representation in volume but produces the same or similar analytical results </li></ul></ul><ul><li>Data discretization </li></ul><ul><ul><li>Part of data reduction but with particular importance, especially for numerical data </li></ul></ul>
    41. 41. Forms of data preprocessing
    42. 42. Data Cleaning <ul><li>Importance </li></ul><ul><ul><li>“ Data cleaning is one of the three biggest problems in data warehousing”—Ralph Kimball </li></ul></ul><ul><ul><li>“ Data cleaning is the number one problem in data warehousing”—DCI survey </li></ul></ul><ul><li>Data cleaning tasks </li></ul><ul><ul><li>Fill in missing values </li></ul></ul><ul><ul><li>Identify outliers and smooth out noisy data </li></ul></ul><ul><ul><li>Correct inconsistent data </li></ul></ul><ul><ul><li>Resolve redundancy caused by data integration </li></ul></ul>
    43. 43. Missing Data <ul><li>Data is not always available </li></ul><ul><ul><li>E.g., many tuples have no recorded value for several attributes, such as customer income in sales data </li></ul></ul><ul><li>Missing data may be due to </li></ul><ul><ul><li>equipment malfunction </li></ul></ul><ul><ul><li>inconsistent with other recorded data and thus deleted </li></ul></ul><ul><ul><li>data not entered due to misunderstanding </li></ul></ul><ul><ul><li>certain data may not be considered important at the time of entry </li></ul></ul><ul><ul><li>not register history or changes of the data </li></ul></ul><ul><li>Missing data may need to be inferred. </li></ul>
    44. 44. How to Handle Missing Data? <ul><li>Ignore the tuple: usually done when class label is missing (assuming the tasks in classification—not effective when the percentage of missing values per attribute varies considerably. </li></ul><ul><li>Fill in the missing value manually: tedious + infeasible? </li></ul><ul><li>Fill in it automatically with </li></ul><ul><ul><li>a global constant : e.g., “unknown”, a new class?! </li></ul></ul><ul><ul><li>the attribute mean </li></ul></ul><ul><ul><li>the attribute mean for all samples belonging to the same class: smarter </li></ul></ul><ul><ul><li>the most probable value: inference-based such as Bayesian formula or decision tree </li></ul></ul>
    45. 45. Noisy Data <ul><li>Noise: random error or variance in a measured variable </li></ul><ul><li>Incorrect attribute values may due to </li></ul><ul><ul><li>faulty data collection instruments </li></ul></ul><ul><ul><li>data entry problems </li></ul></ul><ul><ul><li>data transmission problems </li></ul></ul><ul><ul><li>technology limitation </li></ul></ul><ul><ul><li>inconsistency in naming convention </li></ul></ul><ul><li>Other data problems which requires data cleaning </li></ul><ul><ul><li>duplicate records </li></ul></ul><ul><ul><li>incomplete data </li></ul></ul><ul><ul><li>inconsistent data </li></ul></ul>
    46. 46. How to Handle Noisy Data? <ul><li>Binning method: </li></ul><ul><ul><li>first sort data and partition into (equi-depth) bins </li></ul></ul><ul><ul><li>then one can smooth by bin means , smooth by bin median , smooth by bin boundaries , etc. </li></ul></ul><ul><li>Clustering </li></ul><ul><ul><li>detect and remove outliers </li></ul></ul><ul><li>Combined computer and human inspection </li></ul><ul><ul><li>detect suspicious values and check by human (e.g., deal with possible outliers) </li></ul></ul><ul><li>Regression </li></ul><ul><ul><li>smooth by fitting the data into regression functions </li></ul></ul>
    47. 47. Simple Discretization Methods: Binning <ul><li>Equal-width (distance) partitioning: </li></ul><ul><ul><li>Divides the range into N intervals of equal size: uniform grid </li></ul></ul><ul><ul><li>if A and B are the lowest and highest values of the attribute, the width of intervals will be: W = (B –A)/N. </li></ul></ul><ul><ul><li>The most straightforward, but outliers may dominate presentation </li></ul></ul><ul><ul><li>Skewed data is not handled well. </li></ul></ul><ul><li>Equal-depth (frequency) partitioning: </li></ul><ul><ul><li>Divides the range into N intervals, each containing approximately same number of samples </li></ul></ul><ul><ul><li>Good data scaling </li></ul></ul><ul><ul><li>Managing categorical attributes can be tricky. </li></ul></ul>
    48. 48. Thank you! Department of Computer Science University of Wisconsin – Eau Claire Eau Claire, WI 54701 [email_address] 715-836-2526 Michael R. Wick Professor and Chair