Sequential Pattern Discovery


Published on

Published in: Technology, Education
  • Be the first to comment

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

No notes for slide
  • Different from OLAP -- aimed at discovery of information, without a previously formulated hypothesis Previously unknown -- discovery of patterns that are not intuitive, even counteintuitive. The more away from obvious, the greater the value, eg. Classic example of beer and diapers -- retail store analyzing customer buying patterns discovered strong association between sales of diapers and beer, specially on Friday evenings -- male shoppers. Valid -- if you look long enough at a large collection, bound to find something of interest sooner or later. -- possibility of spurious relations high. Need for post mining validation and sanity checking. Actionable -- must be abler to translate to some business advantage. Eg. Place beer and diapers close, do not discount both together, etc. Prediction: from past cases with known answers, project to new cases. Eg. Fraud detection, healthcare outcomes analysis (treatments are considered cost effective if they fit patterns in previously successful patients), target marketing, investments. Knowledge discovery -- undirected. Stage prior to prediction.
  • Sequential Pattern Discovery

    1. 1. Knowledge Discovery & Data Mining <ul><li>process of extracting previously unknown , valid , and actionable (understandable) information from large databases </li></ul><ul><li>Data mining is a step in the KDD process of applying data analysis and discovery algorithms </li></ul><ul><li>Machine learning, pattern recognition, statistics, databases, data visualization. </li></ul><ul><li>Traditional techniques may be inadequate </li></ul><ul><ul><li>large data </li></ul></ul>
    2. 2. Why Mine Data? <ul><li>Huge amounts of data being collected and warehoused </li></ul><ul><ul><li>Walmart records 20 millions per day </li></ul></ul><ul><ul><li>health care transactions: multi-gigabyte databases </li></ul></ul><ul><ul><li>Mobil Oil: geological data of over 100 terabytes </li></ul></ul><ul><li>Affordable computing </li></ul><ul><li>Competitive pressure </li></ul><ul><ul><li>gain an edge by providing improved, customized services </li></ul></ul><ul><ul><li>information as a product in its own right </li></ul></ul>
    3. 3. <ul><li>Knowledge discovery in databases (KDD) is the non-trivial process of identifying valid, potentially useful and ultimately understandable patterns in data </li></ul>Clean, Collect, Summarize Data Warehouse Data Preparation Training Data Data Mining Model Patterns Verification, Evaluation Operational Databases
    4. 4. Data mining algorithm components <ul><li>Model representation </li></ul><ul><ul><li>descriptions of discovered patterns </li></ul></ul><ul><ul><li>overly limited representation -- unable to capture data patterns </li></ul></ul><ul><ul><li>too powerful -- potential for overfit </li></ul></ul><ul><ul><li>(decision trees, rules, linear/non-linear regression & classification, </li></ul></ul><ul><ul><li>nearest neighbor and case-based reasoning methods, graphical </li></ul></ul><ul><ul><li>dependency models) </li></ul></ul><ul><li>Model evaluation criteria </li></ul><ul><ul><li>how well a pattern (model) meets goals (fit function) </li></ul></ul><ul><ul><li>eg., accuracy, novelty, etc. </li></ul></ul><ul><li>Search method </li></ul><ul><ul><li>parameter search: optimization of of parameters for a given model representation </li></ul></ul><ul><ul><li>model search: considers a family of models </li></ul></ul><ul><li>Different methods suit different problems. Proper problem formulation crucial. </li></ul>
    5. 5. <ul><li>Note: Models and patterns: A pattern can be thought of as an instantiation of a model. Eg. f(x) - 3 x 2 + x is a pattern whereas f(x) = ax 2 + bx is considered a model. </li></ul><ul><li>Data mining involves fitting models to and determining patterns from observed data. </li></ul>
    6. 6. Knowledge Discovery Process <ul><li>Goal </li></ul><ul><ul><li>understanding the application domain, and goals of KDD effort </li></ul></ul><ul><li>Data selection, acquisition, integration </li></ul><ul><li>Data cleaning </li></ul><ul><ul><li>noise, missing data, outliers,etc. </li></ul></ul><ul><li>Exploratory data analysis </li></ul><ul><ul><li>dimensionality reduction, transformations </li></ul></ul><ul><ul><li>selection of appropriate model for analysis, hypotheses to test </li></ul></ul><ul><li>Data mining </li></ul><ul><ul><li>selecting appropriate method that match set goals (classification, regression, clustering, etc) </li></ul></ul><ul><ul><li>selecting algorithm </li></ul></ul><ul><li>Testing and verification </li></ul><ul><li>Interpretation </li></ul><ul><li>Consolidation and use </li></ul>
    7. 7. 0 10 20 30 40 50 60 70 80 90 100 Business Objective Determination Data Preparation Data Mining Analysis of Results and Knowledge Assimilation Effort for each data-mining process step
    8. 8. Issues and challenges <ul><li>large data </li></ul><ul><ul><li>number of variables (features), number of cases (examples) </li></ul></ul><ul><ul><li>multi gigabyte, terabyte databases </li></ul></ul><ul><ul><li>efficient algorithms, parallel processing </li></ul></ul><ul><li>high dimensionality </li></ul><ul><ul><li>large number of features: exponential increase in search space </li></ul></ul><ul><ul><li>potential for spurious patterns </li></ul></ul><ul><ul><li>dimensionality reduction </li></ul></ul><ul><li>Overfitting </li></ul><ul><ul><li>models noise in training data, rather than just the general patterns </li></ul></ul><ul><li>Changing data, missing and noisy data </li></ul><ul><li>Use of domain knowledge </li></ul><ul><ul><li>utilizing knowledge on complex data relationships, known facts </li></ul></ul><ul><li>Understandability of patterns </li></ul>
    9. 9. Data Mining <ul><li>Prediction Methods </li></ul><ul><ul><li>using some variables to predict unknown or future values of other variables </li></ul></ul><ul><li>Descriptive Methods </li></ul><ul><ul><li>finding human-interpretable patterns describing the data </li></ul></ul>
    10. 10. Data Mining Tasks <ul><li>Classification </li></ul><ul><li>Clustering </li></ul><ul><li>Association Rule Discovery </li></ul><ul><li>Sequential Pattern Discovery </li></ul><ul><li>Regression </li></ul><ul><li>Deviation Detection </li></ul>
    11. 11. Classification <ul><li>Data defined in terms of attributes , one of which is the class </li></ul><ul><li>Find a model for class attribute as a function of the values of other(predictor) attributes, such that previously unseen records can be assigned a class as accurately as possible. </li></ul><ul><li>Training Data: used to build the model </li></ul><ul><li>Test data: used to validate the model (determine accuracy of the model) </li></ul><ul><li>Given data is usually divided into training and test sets. </li></ul>
    12. 12. Classification:Example
    13. 13. Classification: Direct Marketing <ul><li>Goal: Reduce cost of soliciting (mailing) by targeting a set of consumers likely to buy a new product. </li></ul><ul><li>Data </li></ul><ul><ul><li>for similar product introduced earlier </li></ul></ul><ul><ul><li>we know which customers decided to buy and which did not {buy, not buy} class attribute </li></ul></ul><ul><ul><li>collect various demographic, lifestyle, and company related information about all such customers - as possible predictor variables. </li></ul></ul><ul><li>Learn classifier model </li></ul>
    14. 14. Classification: Fraud detection <ul><li>Goal: Predict fraudulent cases in credit card transactions. </li></ul><ul><li>Data </li></ul><ul><ul><li>Use credit card transactions and information on its account-holder as input variables </li></ul></ul><ul><ul><li>label past transactions as fraud or fair. </li></ul></ul><ul><li>Learn a model for the class of transactions </li></ul><ul><li>Use the model to detect fraud by observing credit card transactions on a given account. </li></ul>
    15. 15. Clustering <ul><li>Given a set of data points, each having a set of attributes, and a similarity measure among them, find clusters such that </li></ul><ul><ul><li>data points in one cluster are more similar to one another </li></ul></ul><ul><ul><li>data points in separate clusters are less simislar to one another. </li></ul></ul><ul><li>Similarity measures </li></ul><ul><ul><li>Euclidean distance if attributes are continuous </li></ul></ul><ul><ul><li>Problem specific measures </li></ul></ul>
    16. 16. Clustering: Market Segmentation <ul><li>Goal: subdivide a market into distinct subsets of customers where any subset may conceivably be selected as a market target to be reached with a distinct marketing mix. </li></ul><ul><li>Approach: </li></ul><ul><ul><li>collect different attributes on customers based on geographical, and lifestyle related information </li></ul></ul><ul><ul><li>identify clusters of similar customers </li></ul></ul><ul><ul><li>measure the clustering quality by observing buying patterns of customers in same cluster vs. those from different clusters. </li></ul></ul>
    17. 17. 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 occurences of other items </li></ul></ul>
    18. 18. Association Rules:Application <ul><li>Marketing and Sales Promotion: </li></ul><ul><li>Consider discovered rule: </li></ul><ul><ul><li>{Bagels, … } --> {Potato Chips} </li></ul></ul><ul><ul><li>Potato Chips as consequent: can be used to determine what may be done to boost sales </li></ul></ul><ul><ul><li>Bagels as an antecedent: can be used to see which products may be affected if bagels are discontinued </li></ul></ul><ul><ul><li>Can be used to see which products should be sold with Bagels to promote sale of Potato Chips </li></ul></ul>
    19. 19. Association Rules: Application <ul><li>Supermarket shelf management </li></ul><ul><li>Goal: to identify items which are bought together (by sufficiently many customers) </li></ul><ul><li>Approach: process point-of-sale data (collected with barcode scanners) to find dependencies among items. </li></ul><ul><li>Example </li></ul><ul><ul><li>If a customer buys Diapers and Milk, then he is very likely to but Beer </li></ul></ul><ul><ul><li>so stack six-packs next to diapers? </li></ul></ul>
    20. 20. Sequential Pattern Discovery <ul><li>Given: set of objects, each associated with its own timeline of events, find rules that predict strong sequential dependencies among different events, of the form (A B) (C) (D E) --> (F) </li></ul><ul><li>xg :max allowed time between consecutive </li></ul><ul><li>event-sets </li></ul><ul><li>ng: min required time between consecutive </li></ul><ul><li>event sets </li></ul><ul><li>ws: window-size, max time difference between </li></ul><ul><li>earliest and latest events in an event-set (events </li></ul><ul><li>within an event-set may occur in any order) </li></ul><ul><li>ms: max allowed time between earliest and </li></ul><ul><li>latest events of the sequence. </li></ul>
    21. 21. Sequential Pattern Discovery: Examples <ul><li>sequences in which customers purchase goods/services </li></ul><ul><li>understanding long term customer behavior -- timely promotions. </li></ul><ul><li>In point-of--sale transaction sequences </li></ul><ul><ul><li>Computer bookstore: </li></ul></ul><ul><li>(Intro to Visual C++) (C++ Primer) --> (Perl for Dummies, TCL/TK) </li></ul><ul><ul><li>Athletic Apparel Store: </li></ul></ul><ul><li>(Shoes) (Racket, Racketball) --> (Sports Jacket) </li></ul>
    22. 22. Regression <ul><li>Predict a value of a given continuous valued variable (dependent variable) based on values of other variables (independent variables) </li></ul><ul><li>Statistics, Neural networks, Genetic algorithms </li></ul><ul><li>Examples: </li></ul><ul><ul><li>predicting sales volumes of new product based on advertising expenditure </li></ul></ul><ul><ul><li>Time series prediction of stock market indices. </li></ul></ul>
    23. 23. Visualization <ul><li>complement to other DM techniques like Segmentation,etc. </li></ul>
    24. 24. Sample Data Mining Plan: Example <ul><li>Bank concerned about attrition for its Demand Deposit Accounts </li></ul><ul><ul><li>identify customers likely to leave, with sufficient warning of impending attrition to allow for some intervention (signature for impending attrition?) </li></ul></ul><ul><li>Hypothesis testing </li></ul><ul><ul><li>transaction data may be insufficient </li></ul></ul><ul><ul><li>explore ideas about why customers might leave, and how to identify </li></ul></ul><ul><ul><ul><li>e.g. Regular bi-weekly direct deposit ceases: new job and no longer using direct deposits </li></ul></ul></ul><ul><ul><ul><li>got married and spouse used another bank: reduction in balance and number if transactions, last-name change request </li></ul></ul></ul>
    25. 25. <ul><ul><li>Data requirements </li></ul></ul><ul><ul><ul><li>Careful attention to data generated by internal decisions: </li></ul></ul></ul><ul><ul><ul><ul><li>bank started charging for debit card transactions that were free </li></ul></ul></ul></ul><ul><ul><ul><ul><li>bank turned down loan or credit increase request </li></ul></ul></ul></ul><ul><ul><ul><li>Is the data available? </li></ul></ul></ul><ul><ul><li>Preparing data for analysis </li></ul></ul><ul><ul><li>Exploratory analysis of data </li></ul></ul><ul><ul><ul><li>queries, OLAP, hypothesis testing </li></ul></ul></ul><ul><ul><ul><li>association rules </li></ul></ul></ul><ul><li>Knowledge Discovery plan </li></ul><ul><ul><li>classes of customers rather than an overall signature of attrition? </li></ul></ul><ul><ul><li>Deviation from normal behavior indicating attrition potential </li></ul></ul>
    26. 26. <ul><ul><li>Preparing data for analysis </li></ul></ul><ul><ul><ul><li>data organized over time-windows </li></ul></ul></ul><ul><ul><ul><li>demographic profiles </li></ul></ul></ul><ul><ul><li>Clustering </li></ul></ul><ul><ul><ul><li>unsupervised </li></ul></ul></ul><ul><ul><li>models for different clusters </li></ul></ul>
    27. 27. Example:improving direct mail responses <ul><li>Direct mailing for home equity line of credit (HELOC) </li></ul><ul><ul><li>prospects are existing demand deposit account (DDA) customers </li></ul></ul><ul><ul><li>use info. on lifetime value of existing customers to derive model to predict customers likely to be the most profitable long-term prospects </li></ul></ul>DDA customers (~250K cases) HELOC customers ~ 40K cases
    28. 28. Example <ul><li>Data </li></ul><ul><ul><li>DDA history of loan balances over 3,6,9,12,18 months, returned checks </li></ul></ul><ul><ul><li>demographic data (age, income, length of residence, etc.), both internal and external </li></ul></ul><ul><ul><li>property data sourced externally (home purchase price, loan-to-value ratio, etc.) </li></ul></ul><ul><ul><li>credit worthiness data </li></ul></ul><ul><ul><li>response to previous mailings </li></ul></ul><ul><ul><li>120 variables selected </li></ul></ul><ul><ul><li>less than half the DDAs had history records; missing fields; (45 K cases remaining for use -- prospects database) </li></ul></ul><ul><ul><li>exclude variables like sex, race, age (legal restrictions) </li></ul></ul><ul><li>Neural network (radial basis function) model for value prediction </li></ul>
    29. 29. Example <ul><li>Training data </li></ul><ul><ul><li>randomly sample from prospects database; weighted to include more responders than present in actual data </li></ul></ul><ul><li>Validation </li></ul><ul><ul><li>rank on likelihood of response </li></ul></ul><ul><ul><li>consider top and bottom 10% -- use visualization, decision tree to understand rationale for obtained classification </li></ul></ul><ul><li>Testing </li></ul><ul><ul><li>sample from prospects database; unweighted with normal proportion of responders and non-responders </li></ul></ul><ul><ul><li>gains (lift) chart </li></ul></ul>
    30. 30. Example: Lift analysis