(Understanding customer behavior Using data mining skills)

Slides:



Advertisements
Similar presentations
Data Mining Lecture 9.
Advertisements

Data Mining Techniques Association Rule
Rule Generation from Decision Tree Decision tree classifiers are popular method of classification due to it is easy understanding However, decision tree.
Paper By - Manish Mehta, Rakesh Agarwal and Jorma Rissanen
Decision Tree Approach in Data Mining
Classification and Prediction
Mining Association Rules
Classification.
Mining Association Rules in Large Databases. What Is Association Rule Mining?  Association rule mining: Finding frequent patterns, associations, correlations,
Pattern Recognition Lecture 20: Data Mining 3 Dr. Richard Spillman Pacific Lutheran University.
Chapter 5 Data mining : A Closer Look.
Beyond Opportunity; Enterprise Miner Ronalda Koster, Data Analyst.
Association Discovery from Databases Association rules are a simple formalism for expressing positive connections between columns in a 0/1 matrix. A classical.
Chapter 7 Decision Tree.
Basic Data Mining Techniques
Data Mining Using IBM Intelligent Miner Presented by: Qiyan (Jennifer ) Huang.
Rapid Miner Session CIS 600 Analytical Data Mining,EECS, SU Three steps for use  Assign the dataset file first  Select functionality  Execute.
DATA MINING : CLASSIFICATION. Classification : Definition  Classification is a supervised learning.  Uses training sets which has correct answers (class.
Basic Data Mining Technique
Knowledge Discovery & Data Mining process of extracting previously unknown, valid, and actionable (understandable) information from large databases Data.
Dr. Chen, Data Mining  A/W & Dr. Chen, Data Mining Chapter 2 Data Mining: A Closer Look Jason C. H. Chen, Ph.D. Professor of MIS School of Business Administration.
EXAM REVIEW MIS2502 Data Analytics. Exam What Tool to Use? Evaluating Decision Trees Association Rules Clustering.
Chapter 11 Statistical Techniques. Data Warehouse and Data Mining Chapter 11 2 Chapter Objectives  Understand when linear regression is an appropriate.
Data Mining Find information from data data ? information.
Lecture 4: Association Market Basket Analysis Analysis of Customer Behavior and Service Modeling.
Decision Tree (Rule Induction)
Chapter 6 Classification and Prediction Dr. Bernard Chen Ph.D. University of Central Arkansas.
Chapter 6. Classification and Prediction Classification by decision tree induction Bayesian classification Rule-based classification Classification by.
Classification and Prediction
ISQS 7342 Dr. zhangxi Lin By: Tej Pulapa. DT in Forecasting Targeted Marketing - Know before hand what an online customer loves to see or hear about.
1 Classification: predicts categorical class labels (discrete or nominal) classifies data (constructs a model) based on the training set and the values.
Data Mining By Farzana Forhad CS 157B. Agenda Decision Tree and ID3 Rough Set Theory Clustering.
Data Mining  Association Rule  Classification  Clustering.
DECISION TREES Asher Moody, CS 157B. Overview  Definition  Motivation  Algorithms  ID3  Example  Entropy  Information Gain  Applications  Conclusion.
Chapter 8 Association Rules. Data Warehouse and Data Mining Chapter 10 2 Content Association rule mining Mining single-dimensional Boolean association.
Lecture 10 (big data) Knowledge Induction using association rule and decision tree (Understanding customer behavior Using data mining skills)
Chapter 3 Data Mining: Classification & Association Chapter 4 in the text box Section: 4.3 (4.3.1),
DATA MINING TECHNIQUES (DECISION TREES ) Presented by: Shweta Ghate MIT College OF Engineering.
Mining Association Rules in Large Database This work is created by Dr. Anamika Bhargava, Ms. Pooja Kaul, Ms. Priti Bali and Ms. Rajnipriya Dhawan and licensed.
Data Mining: Confluence of Multiple Disciplines Data Mining Database Systems Statistics Other Disciplines Algorithm Machine Learning Visualization.
An Introduction to WEKA
Chapter 6 Decision Tree.
Data Mining Find information from data data ? information.
By Arijit Chatterjee Dr
DECISION TREES An internal node represents a test on an attribute.
Association rule mining
Chapter 6 Classification and Prediction
Mining Association Rules
Knowledge discovery & data mining Association rules and market basket analysis--introduction UCLA CS240A Course Notes*
I. Association Market Basket Analysis.
Waikato Environment for Knowledge Analysis
©Jiawei Han and Micheline Kamber
Classification and Prediction
Data Mining II: Association Rule mining & Classification
Data Analysis.
Mining Association Rules in Large Databases
Big Data.
MIS2502: Data Analytics Classification using Decision Trees
Analysis of Customer Behavior and Service Modeling
Data Mining – Chapter 3 Classification
Frequent patterns and Association Rules
CSCI N317 Computation for Scientific Applications Unit Weka
©Jiawei Han and Micheline Kamber
I. Association Market Basket Analysis.
Department of Computer Science National Tsing Hua University
Decision Tree Concept of Decision Tree
Association Rues Analysis .Event A -> Event ?
©Jiawei Han and Micheline Kamber
Decision Tree (Rule Induction)
Presentation transcript:

(Understanding customer behavior Using data mining skills) Lecture 10 Knowledge Induction using association rule and decision tree (Understanding customer behavior Using data mining skills)

Part I. Association Rule Analysis Market Basket Analysis

What Is Association Mining? Association rule mining: Finding frequent patterns, associations, correlations, or causal structures among sets of items or objects in transaction databases, relational databases, and other information repositories. Applications: Market basket analysis, cross-marketing, catalog design, loss-leader analysis, clustering, classification, etc. Examples: Rule form: “Body ® Head [support, confidence]” buys(x, “diapers”) ® buys(x, “beers”) [0.5%, 60%] major(x, “CS”) ^ takes(x, “DB”) ® grade(x, “A”) [1%, 75%]

Support and Confidence Percent of samples contain both A and B support(A  B) = P(A ∩ B) Confidence Percent of A samples also containing B confidence(A  B) = P(B|A) Example computer  financial_management_software [support = 2%, confidence = 60%]

Association Rules: Basic Concepts Given: (1) database of transactions, (2) each transaction is a list of items (purchased by a customer in a visit) Find: all rules that correlate the presence of one set of items with that of another set of items e.g., 98% of people who purchase tires and auto accessories also get automotive services done Applications Home Electronics - What other products should the store stocks up? Retailing – Shelf design, promotion structuring, direct marketing

Rule Measures: Support and Confidence Find all the rules A  C with minimum confidence and support Support (s) probability that a transaction contains {A & C} Confidence (c) conditional probability that a transaction having {A} also contains {C} Customer buys both Customer buys diaper Customer buys beer Let minimum support 50%, and minimum confidence 50%, we have A  C (50%, 66.6%) C  A (50%, 100%)

Mining Association Rules: An Example Target: Min. support 50% Min. confidence 50% For rule A  C: support = support({A, C}) = 50% confidence = support({A, C})/support({A}) = 66.6%

An Example of Market Basket(1) There are 8 transactions on three items on A, B , C. Check associations for below two cases. (1) A  B (2) (A, B)  C # Basket 1 A 2 B 3 C 4 A, B 5 A, C 6 B, C 7 A, B, C 8

An Example of Market Basket(1(2) Basic probabilities are below: (1) AB (2) (A, B)  C LHS P(A) = 5/8 = 0.625 P(A,B) = 3/8 = 0.375 RHS P(B) = 5/8 = 0.625 P(C) = 5/8 = 0.625 Coverage LHS = 0.625 LHS = 0.375 Support P(A∩B) = 3/8 = 0.375 P((A,B)∩C)) = 2/8 =0.25 Confidence P(B|A)=0.375/0.625=0.6 P(C|(A,B))=0.25/0.375=0.7 Lift 0.375/(0.625*0.625)=0.96 0.25/(0.375*0.625)=1.07 Leverage 0.375 - 0.390 = -0.015 0.25 - 0.234 = 0.016

Lift What are good association rules? (How to interpret them?) If lift is close to 1, it means there is no association between two items (sets). If lift is greater than 1, it means there is a positive association between two items (sets). If lift is less than 1, it means there is a negative association between two items (sets).

Leverage Leverage = P(A∩B) - P(A)*P(B) , it has three types ① Two items (sets) are positively associated ② Two items (sets) are independent ③Two items (sets) are negarively associated

Lab on Association Rules(1) SPSS Clementine, SAS Enterprise Miner have association rules softwares. This exercise uses Magnum Opus. Go to http://www.rulequest.com and download Magnum Opus evaluation version ( click)

After you install the problem, you can see below initial screen After you install the problem, you can see below initial screen. From menu, choose File – Import Data (Ctrl – O).

Demo Data sets are already there Demo Data sets are already there. Magnum Opus has two types of data sets available: (transaction data: *.idi, *.itl) and (attribute-value data: *.data, *.nam) Data format has below two types:(*.idi, *.itl). idi (identifier-item file) itl (item list file) 001, apples 001, oranges 001, bananas 002, apples 002, carrots 002, lettuce 002, tomatoes apples, oranges, bananas apples, carrots, lettuce, tomatoes

If you open tutorial.idi using note pad, you can see the file inside as left. The example left has 5 transactions (baskets)

File – Import Data, or click . click Tutorial.idi Check Identifier – item file and click Next >.

Click Yes and click Next > …

Click Next > … What percentage of whole file you want to use? Type 50% and click Next > …

click Import Data를 클릭 Then, you can see a screen like below left.

Set things as they are. Click GO Search by: LIFT Minimum lift: 1 Maximum no. of rules: 10 Click GO

Results are saved in tutorial.out file. Below are rules derived: lettuce & carrots are associated with tomatoes with strength = 0.857 coverage = 0.042: 21 cases satisfy the LHS support = 0.036: 18 cases satisfy both the LHS and the RHS lift 3.51: the strength is 3.51 times greater than the strength if there were no association leverage = 0.0258: the support is 0.0258 (12.9 cases) greater than

lettuce & carrots  tomatoes When Lettuce and carrots are purchase then they buy tomatoes coverage = 0.042: 21 cases satisfy the LHS LHS(lettuce & carrots) = 21/500 = 0.042 support = 0.036: 18 cases satisfy both the LHS and the RHS P((lettuce & carrots) ∩ tomatoes)) = 18/500 = 0.036 strength(confidence) = 0.857 P(support|LHS)= 18/21 = 0.036/0.042 = 0.857

lift 3.51: the strength is 3.51 times greater than the strength if there were no association 즉, (18/21)/(122/500) = 3.51 leverage = 0.0258: the support is 0.0258 (12.9 cases) greater than if there were no association P(LHS ∩ RHS) – P(A)*P(B) = 0.036 – 0.042*0.244 = 0.0258

Part II: Knowledge Induction from Data

Poll: Which data mining technique..?

Classification Process Step 1: Model Construction Algorithms Training Data Classifier (Model) IF rank = ‘professor’ OR years > 6 THEN tenured = ‘yes’

Classification Process Step 2: Use the Model in Prediction Classifier Testing Data Unseen Data (Jeff, Professor, 4) Tenured?

Classification by Decision Tree Induction A flow-chart-like tree structure Internal node denotes a test on an attribute Branch represents an outcome of the test Leaf nodes represent class labels or class distribution Decision tree generation consists Tree construction At start, all the training examples are at the root Examples are recursively partitioned based on selected attributes Use of decision tree: Classifying an unknown sample

Training Dataset This follows an example from Quinlan’s ID3

Tree Output: A Decision Tree for Credit Approval age? <=30 overcast 30..40 >40 student? yes credit rating? no yes excellent fair no yes yes no

Extracting Classification Rules from Trees Represent the knowledge in the form of IF-THEN rules One rule is created for each path from the root to a leaf Each attribute-value pair along a path forms a conjunction The leaf node holds the class prediction Rules are easier for humans to understand Example IF age = “<=30” AND student = “no” THEN buys_computer = “no” IF age = “<=30” AND student = “yes” THEN buys_computer = “yes” IF age = “31…40” THEN buys_computer = “yes” IF age = “>40” AND credit_rating = “excellent” THEN buys_computer = “yes” IF age = “>40” AND credit_rating = “fair” THEN buys_computer = “no”

Decision Trees: Attribute Selection Methods Information gain (ID3/C4.5) ID3 - All attributes are assumed to be categorical C4.5 - Modified ID3 for continuous attributes

Decision Tree) Concept of Decision Tree Tree-like graph for classification purpose분류 Through recursive partitioning it consists of root node, internal nodes, link, leaf

An Example of ‘Car Buyers’ no Job M/F Area Age Y/N 1 NJ M N 35 2 F 51 3 OW 31 Y 4 EM 38 5 S 33 6 54 7 49 8 32 9 10 11 12 50 13 36 14 * (a,b,c) means a: total # of records, b: ‘N’ counts, c: ‘Y’ counts

Lab on Decision Tree(1) SPSS Clementine, SAS Enterprise Miner See5/C5.0Download See5/C5.0 2.02 Evaluation from http://www.rulequest.com

Lab on Decision Tree(2) From below initial screen, choose File – Locate Data

Lab on Decision Tree(3) Select housing.data from Samples folder and click open.

Lab on Decision Tree(3(4) This data set is on deciding house price in Boston area. It has 350 cases and 13 variables.

Lab on Decision Tree (5) Input variables crime rate proportion large lots: residential space proportion industrial: ratio of commercial area CHAS: dummy variable nitric oxides ppm: polution rate in ppm av rooms per dwelling: # of room for dwelling proportion pre-1940 distance to employment centers: distance to the center of city accessibility to radial highways: accessibility to high way property tax rate per $10\,000 pupil-teacher ratio: teachers’ rate B: racial statistics percentage low income earners: ratio of low income people Decision variable Top 20%, Bottom 80%

Lab on Decision Tree(6) For the analysis, click Construct Classifier or click Construct Classifier from File menu

Lab on Decision Tree(7) Click on Global pruning to (V ). Then, click OK

Lab on Decision Tree(8) Decision Tree Evaluation with Training data Evaluation with Test data

Lab on Decision Tree(9) Understanding picture We can see that (av rooms per dwelling) is the most important variable in deciding house price.

Lab on Decision Tree(11) 의사결정나무 그림으로는 규칙을 알아보기 어렵다. To view the rules, close current screen and click Construct Classifier again or click Construct Classifier from File menu.

Lab on Decision Tree(12) Choose/click Rulesets. Then click OK.

Lab on Decision Tree(13)