2a. Basic Data Mining Techniques
2a. Basic Data Mining Techniques
Description Methods
Find human-interpretable patterns that describe the data.
From [Fayyad, et.al.] Advances in Knowledge Discovery and Data Mining, 1996
Classification: Definition
Given a collection of records (training set )
Each record contains a set of attributes one of the attributes is attributes, the class.
Find a model for class attribute as a function of the values of other attributes. l f h ib Goal: previously unseen records should be assigned a class as accurately as p y possible.
A test set is used to determine the accuracy of the model. Usually, the given data set is divided into training and test sets, with training set used to build the model and test set used to g validate it.
Classification Example
Tid Refund Marital Status 1 2 3 4 5 6 7 8 9 10
10
No Yes No Yes
Test Set
Training Set
Learn Classifier
Model
Classification: Application 1
Direct Marketing Goal: Reduce cost of mailing by targeting a set of consumers likely to buy a new cell-phone product. Approach:
Use the data for a similar product introduced before. We know which customers decided to buy and which decided otherwise. This {buy, dont buy} decision forms the class attribute. Collect various d C ll demographic, lifestyle, and company-interaction related h lf l d l d information about all such customers. Type of business, where they stay, how much they earn, etc. Use this information as i U thi i f ti input attributes t l t tt ib t to learn a classifier model. l ifi d l
Classification: Application 2
Fraud Detection Goal: Predict fraudulent cases in credit card transactions transactions. Approach:
Use credit card transactions and the information on its account-holder as attributes. When does a customer buy, what does he buy, how often he pays on time, etc Label past transactions as fraud or fair transactions. This forms the class attribute. attribute Learn a model for the class of the transactions. Use this model to detect fraud by observing credit card transactions on an account.
Classification: Application 3
Customer Attrition/Churn:
Goal: To predict whether a customer is likely to be lost to a competitor. Approach:
Use detailed record of transactions with each of the past and present customers, to find attributes. How often the customer calls, where he calls, what time-ofthe day he calls most, his financial status, marital status, etc. Label the customers as loyal or disloyal. Find a model for loyalty. y y
Classification: Application 4
Sky Survey Cataloging Goal: To predict class (star or g p ( galaxy) of sky objects, especially y) y j p y visually faint ones, based on the telescopic survey images (from Palomar Observatory).
3000 images with 23,040 x 23,040 pixels per image. g p p g
Approach:
Segment the image. Measure image attributes (features) - 40 of them per object object. Model the class based on these features. Success Story: Could find 16 new high red-shift quasars, some of the farthest objects that are difficult to find!
From [Fayyad, et.al.] Advances in Knowledge Discovery and Data Mining, 1996
Clustering Definition
Given a set of data points, each having a set of attributes, and a similarity measure among them, find clusters such y g that
Data points in one cluster are more similar to one another. Data points in separate clusters are less similar to one another.
Similarity Measures:
Euclidean Distance if attributes are continuous. Other Problem-specific Measures.
Illustrating Clustering
Euclidean Distance Based Clustering in 3-D space.
Clustering: Application 1
Market Segmentation: 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. Approach:
Collect different attributes of customers based on their geographical and lifestyle related information. Find clusters of similar customers. Measure the clustering quality b observing buying patterns of customers M h l i li by b i b i f in same cluster vs. those from different clusters.
Clustering: Application 2
Document Clustering:
Goal: To find groups of documents that are similar to each other based on the important terms appearing in them. Approach: To identify frequently occurring terms in each document. Form a similarity measure b d on the d F i il i based h frequencies of different terms. Use it to cluster. Gain: Information Retrieval can utilize the clusters to relate a new document or search term to clustered documents.
Correctly Placed
364 260 36 746 573 278
1 2 3 4
Technology1-DOWN
Technology2-DOWN
Financial-DOWN Oil-UP
TID
Items
1 2 3 4 5
Bread, Coke, Milk Beer, Bread Beer, Coke, Diaper, Milk Beer, Bread, Diaper, Milk Coke, Diaper, Milk
Rules Discovered:
{Milk} --> {Coke} {Diaper, Milk} --> {Beer}
(A B)
(C)
(D E)
Rules are formed by first disovering patterns. Event occurrences in the patterns are governed by timing constraints.
(A B)
<= xg
(C)
<= ms
(D E)
>ng <= ws
Regression
Predict a value of a given continuous valued variable based on the values of other variables, assuming a linear or nonlinear model of dependency. Greatly studied in statistics, neural network fields. Examples: Predicting sales amounts of new product based on advetising expenditure. Predicting wind velocities as a function of temperature, humidity, air pressure, etc. Time series prediction of stock market indices.
Deviation/Anomaly Detection
Detect significant deviations from normal behavior Applications: pp
Credit Card Fraud Detection
Typical network traffic at University level may reach over 100 million connections per day
Roiger, 2003
Classical View
All concepts have definite defining properties. Example:
If
annual income >= 30,000 & years at current position >= 5 & owns h home = true
Then
Good Credit Risk = true
Probabilistic View
Concepts are represented by properties that are p probable of concept number p Example
A good credit risk might look like:
The mean annual income for individuals who consistently make loan payments on time is $30,000 Most individuals who are good credit risks have been working for the same company for at least 5 years The majority of good credit risks own their own home
A homeowner with an annual incomeof $27,000 employed at the h h l f $27 000 l d h same position for 4 years might be classified as a good credit risk with a probability of 0.85
Exemplar View
People store and recall likely concept exemplars that are used to classify unknown instances.
Exemplar#1 p Annual income = 32,000 Number of years at current position = 6 Homeowner Exemplar#2 Annual income = 52,000 Number of years at current position = 16 Renter
DM Categories
Supervised Learning
Build a learner model using data instances of known origin origin. Use the model to determine the outcome new instances of unknown origin
Unsupervised Learning
A data mining method th t builds models from data without d t i i th d that b ild d l f d t ith t predefined classes.
Decision Tree
A tree structure where non-terminal nodes represent tests on one or more attributes and terminal nodes reflect decision outcomes.
Sore Throat
Yes No Yes Yes No No No Yes No Yes
Fever
Yes No Yes No Yes No No No Yes Yes
Swollen Glands
Yes No No Yes No No Yes No No No
Congestion
Yes Yes Yes No Yes Yes No Yes Yes Yes
Headache
Yes Yes No No No No No Yes Yes Yes
Diagnosis
Strep throat Allergy Cold Strep throat Cold Allergy Strep throat Allergy Cold Cold
Input Attributes
Output Attributes
Swollen Glands
No
Yes
Diagnosis = Strep Throat
Fever
No
Diagnosis = Allergy
Yes
Diagnosis = Cold
Sore Throat
No Yes No
Fever
No Yes No
Swollen Glands
Yes No No
Congestion
Yes No No
Headache
Yes Yes Yes
Diagnosis
? ? ?
Production Rules
Translation from decision tree Form:
IF antecedant conditions THEN consequent conditions
Example
IF Swollen Glands = Yes THEN Diagnosis = Strep Throat IF Swollen Glands = No & Fever = Yes THEN Diagnosis = Cold IF Swollen Glands = No & Fever = No THEN Diagnosis = Allergy
Can I develop a general profile of an online investor? Can I determine if a new customer is likely to open a margin account? Can build C I b ild a model predict th average number of trades per month for d l di t the b ft d th f a new investor? What characteristics differentiate female and male investors?
Output attribute:
No 1. transaction method No 2. margin account No 3. trades/month No 4. sex
What attribute similarities group customers of Acme Investors together? What differences in attribute values segment the customer database?
Unsupervised Clustering
Require us to provide an initial best estimate about the total number of clusters in the data, OR Use an algorithm to determine a best number of clusters g In either case, a clustering system will attempt to group g y p g p instances into clusters of significant interests
A Closer Look
REFERENCES
Dunham chapter 1.2 Roiger chapter 5