Download Data Mining

Document related concepts

Cluster analysis wikipedia , lookup

Nonlinear dimensionality reduction wikipedia , lookup

Transcript
CENG 464
Introduction to Data Mining
1
Data Mining:
The Background
• Facts:
– Storing the data is an operational necessity
– Storing the data has become easy and affordable
– Data acquisition is fully or partially automatic and fast
• Consequences:
– The speed of data comprehension does not match the speed of
data acquisition
– Many commercial database management systems (DBMSs) are
not equipped with data comprehension and analysis tools.
– We may be data rich, but information poor.
2
Big Data Examples
• Europe's Very Long Baseline Interferometry (VLBI)
has 16 telescopes, each of which produces 1
Gigabit/second of astronomical data over a 25day observation session
– storage and analysis a big problem
• AT&T handles billions of calls per day
– so much data, it cannot be all stored -- analysis has to
be done “on the fly”, on streaming data
• data is measured in Exabytes
– What is exabyte?
3
Data Growth
In 2 years, the size of the largest database TRIPLED!
Knowledge Discovery is NEEDED to make sense and use
of data.
4
What Is Data Mining?
• Data mining (knowledge discovery from data)
– Extraction of interesting (non-trivial, implicit, previously unknown and
potentially useful) patterns or knowledge from huge amount of data
– Data mining: a misnomer?
• Alternative names
– Knowledge discovery (mining) in databases (KDD), knowledge
extraction, data/pattern analysis, data archeology, data dredging,
information harvesting, business intelligence, etc.
• Watch out: Is everything “data mining”?
– Simple search and query processing
– (Deductive) expert systems
5
Data Mining: Useful Information
Example 1 (A well-known example, not a joke):
Customers who purchase beer are also likely (say 90%) to
purchase nappies.
Example 2 (May already be in practical use in credit card
applications):
If 20,000  Customer’s Salary  40,000 dollar and
Customer has a house, then Customer is a safe
customer.
6
Origins of Data Mining
• Draws ideas from machine learning/AI, pattern
recognition, statistics, and database systems
• Traditional Techniques
may be unsuitable due to
Statistics/
Machine Learning/
– Enormity of data
– High dimensionality
of data
– Heterogeneous,
distributed nature
of data
AI
Pattern
Recognition
Data Mining
Database
systems
7
Data Mining: Confluence of Multiple
Disciplines
Database
Technology
Machine
Learning
Statistics
Data Mining
Information
Science
Visualization
Other
Disciplines
8
Why Data Mining?—Potential Applications
•
•
Data analysis and decision support
– Market analysis and management
• Target marketing, customer relationship management (CRM), market basket analysis,
cross selling, market segmentation
– Risk analysis and management
• Forecasting, customer retention, improved underwriting, quality control, competitive
analysis
– Fraud detection and detection of unusual patterns (outliers)
Other Applications
– Text mining (news group, email, documents) and Web mining
– Stream data mining
– Bioinformatics and bio-data analysis
– Medicine
– Agriculture
– Society, politics and economics
– Science
– Engineering
– Law enforcement
– Military and intelligence (classified)
9
Data Mining and Business Intelligence
Making
Decisions
Data Presentation
Visualization Techniques
Data Mining
Information Discovery
Data Exploration
Statistical Analysis, Querying and Reporting
Data Warehouss / Data Marts
10
Data Mining: On What Kind of
Data?
•
•
•
•
Relational databases
Data warehouses
Transactional databases
Advanced DB and information repositories
–
–
–
–
–
–
–
–
–
Object-oriented and object-relational databases
Spatial databases - images
Time-series data and temporal data, sequence data
Text databases and multimedia databases
Heterogeneous and legacy databases
WWW
Data streams of sensors
Structured data – networks, graphs
Spatiotemporal - video
11
Customer Attrition: Example
 Situation: Attrition rate at for mobile phone customers
is around 25-30% a year!
 With this in mind, what is our task?
 Assume we have customer information for the past N months.
 Task:
 Predict who is likely to attrite next month.
 Estimate customer value and what is the cost-effective
offer to be made to this customer.
12
Assessing Credit Risk: Example
• Situation: Person applies for a loan
• Task: Should a bank approve the loan?
• Note: People who have the best credit don’t need the loans,
and people with worst credit are not likely to repay. Bank’s
best customers are in the middle
• Banks develop credit models using variety of machine
learning methods.
• Mortgage and credit card proliferation are the results of being
able to successfully predict if a person is likely to default on a
loan
• Widely deployed in many countries
13
e-commerce: Example
• A person buys a book (product) at
Amazon.com
What is the task?
14
Successful e-commerce – Example
• Task: Recommend other books (products) this
person is likely to buy
• Amazon does clustering based on books
bought:
– customers who bought “Advances in Knowledge
Discovery and Data Mining”, also bought “Data
Mining: Practical Machine Learning Tools and
Techniques with Java Implementations”
• Recommendation program is quite successful
15
Medicine – Example
Given microarray data for a number of samples
(patients), can we
• Accurately diagnose the disease?
• Predict outcome for given treatment?
• Recommend best treatment?
16
Data science
Data science is about using data to make
decisions that drive actions.
Data science involves:
– Finding data
– Acquiring data
– Cleaning and transforming data
– Understanding relationships in data
– Delivering value from data
17
Data science
18
Data science
19
Data science
20
Knowledge Discovery (KDD) Process
– Data mining—core of
knowledge discovery
process
Pattern Evaluation
Data Mining
Task-relevant Data
Data Warehouse
Selection
Data Cleaning
Data Integration
Databases
21
KDD Process: Several Key Steps
• Learning the application domain
– relevant prior knowledge and goals of application
• Creating a target data set: data selection
• Data cleaning and preprocessing: (may take 60% of effort!)
• Data reduction and transformation
– Find useful features, dimensionality/variable reduction, invariant representation
• Choosing functions of data mining
– summarization, classification, regression, association, clustering
• Choosing the mining algorithm(s)
• Data mining: search for patterns of interest
• Pattern evaluation and knowledge presentation
– visualization, transformation, removing redundant patterns, etc.
• Use of discovered knowledge
22
Data Mining Tasks
• Prediction Methods
– Use some variables to predict unknown or future
values of other variables.
• Description Methods
– Find human-interpretable patterns that describe
the data.
From [Fayyad, et.al.] Advances in Knowledge Discovery and Data Mining, 1996
23
Major Data Mining Tasks
• Classification: Predicting a Boolean true/false value for
an entity with a given set of features
• Regression: Predicting a real numeric value for an
entity with a given set of features
• Clustering: Grouping entities with similar features
• Recommendations: Recommending an item to a user
based on past behaviour or preferences of similar users
• Associations: e.g. A & B & C occur frequently
• Deviation Detection: finding changes
• Visualization: to facilitate human discovery
• …
24
Classification
• Observations: learn by examples
Is it a table?
Show images, tell which are
chairs which are not..
25
Classification
training set of examples
Test set
table
Not a table
Not a table
table
Not a table
Not a table
Not a table
labels
26
Classification
• Each observation is represented by numbers:
Image becomes vectors of numbers (rgb values
of each pixel)-features
[1.0 5.9 8.6 ]
label -1 (not chair)
27
Classification
• Each observation is represented by numbers:
features
Age Salary id, number of years… Customer type (1-Good/-1 Bad)
[40, 2563, 111,25,……]
[50, 5555, 777,33……]
[25, 1111, 0123,45……]
Features - X
1
-1
1
label- Y
(predictors, explanatory
variables,covariats)
28
Classification
• Given training set (xi,yi) pairs, find a
classification model f that predicts y for a
given x
f(x)=0
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ ++ +
+ +
+
++
-
- - - - - - - - - - -
29
Classification
• Given a collection of records (training set )
– Each record contains a set of attributes/features, one of the
attributes is the class.
• Find a model for class attribute as a function of
the values of other attributes.
• Goal: previously unseen records should be
assigned a class as accurately as 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 validate it.
30
Classification
• Goal: Predict class Ci = f(x1, x2, .. Xn)
• Nearest neighbour
• Decision tree classifier: divide decision space into
piecewise constant regions.
• Probabilistic/generative models
• Neural networks: partition by non-linear
boundaries
31
Classification Example
• Given old data about customers and payments,
predict new applicant’s loan eligibility.
Previous customers
Age
Salary
Profession
Location
Customer type
(Good/Bad)
Classifier
Decision rules
Salary > 5 L
Prof. = Exec
Good/
bad
New applicant’s data
32
Classification Example
Tid Refund Marital
Status
Taxable
Income Cheat
Refund Marital
Status
Taxable
Income Cheat
1
Yes
Single
125K
No
No
Single
75K
?
2
No
Married
100K
No
Yes
Married
50K
?
3
No
Single
70K
No
No
Married
150K
?
4
Yes
Married
120K
No
Yes
Divorced 90K
?
5
No
Divorced 95K
Yes
No
Single
40K
?
6
No
Married
No
No
Married
80K
?
60K
10
7
Yes
Divorced 220K
No
8
No
Single
85K
Yes
9
No
Married
75K
No
10
10
No
Single
90K
Yes
Training
Set
Learn
Classifier
Test
Set
Model
33
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, don’t buy} decision forms the class attribute.
• Collect various demographic, lifestyle, and company-interaction
related information about all such customers.
– Type of business, where they stay, how much they earn, etc.
• Use this information as input attributes to learn a classifier model.
From [Berry & Linoff] Data Mining Techniques, 1997
34
Classification: Application 2
• Fraud Detection
– Goal: Predict fraudulent cases in credit card transactions.
– Approach:
• Use credit card transactions and the information on its accountholder 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.
• Learn a model for the class of the transactions.
• Use this model to detect fraud by observing credit card
transactions on an account.
35
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-of-the day he calls most, his financial status,
marital status, etc.
• Label the customers as loyal or disloyal.
• Find a model for loyalty.
From [Berry & Linoff] Data Mining Techniques, 1997
36
Classification: Application 4
• Sky Survey Cataloging
– Goal: To predict class (star or galaxy) of sky
objects, especially visually faint ones, based
on the telescopic survey images (from
Palomar Observatory).
– 3000 images with 23,040 x 23,040 pixels per
image.
– Approach:
• Segment the image.
• Measure image attributes (features) - 40 of
them per object.
• Model the class based on these features.
• Success Story: Could find 16 new high redshift quasars, some of the farthest objects
that are difficult to find!
From [Fayyad, et.al.] Advances in Knowledge Discovery and Data Mining, 1996
37
Classifying Galaxies
Early
Class:
• Stages of Formation
Attributes:
• Image features,
• Characteristics of light
waves received, etc.
Intermediate
Late
Data Size:
• 72 million stars, 20 million galaxies
• Object Catalog: 9 GB
• Image Database: 150 GB
38
Courtesy: http://aps.umn.edu
Regression
• Predict a value of a given continuous valued variable based on
the values of other variables
• Examples:
– Predicts sale of new cell phone
– 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.
39
Regression
• Each observation is represented by numbers:
features
Age Salary id, number of years…
[40, 2563, 111,25,……]
[50, 5555, 777,33……]
[25, 1111, 0123,45……]
Features - X
call duration
100
152
420
label- Y
(predictors, explanatory
variables,covariats)
40
Regression
Given each observation (xi,yi) find a regression model to predict Y for a new X
Age
call duration
[40]
[50]
[25]
100
152
420
single Feature - X
label- Y
Overfitting&underfitting
41
Regression
Given each observation (xi,yi) find a regression model to predict Y for a new X
Age
[40]
[50]
[25]
call duration
100
152
420
42
Regression
Given each observation (xi,yi) find a regression model to predict Y for a new X
Age
[40]
[50]
[25]
call duration
100
152
420
43
supervised learning
• Classification and regression use data with known
values to train a machine learning model so that
it can identify unknown values for other data
entities with similar attributes.
• Classification is used to identify Boolean
(True/False) values. Regression is used to identify
real numeric values. So a question like "In this a
chair?" is a classification problem, while "How
much does this person earn?" is a regression
problem.
44
Clustering Definition
• Given a set of data points, each having a set of attributes, and a similarity
measure among them, find clusters such 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.
45
Illustrating Clustering
Intracluster distances
are minimized
Intercluster distances
are maximized
46
Clustering: Application
• 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 by observing buying patterns of
customers in same cluster vs. those from different clusters.
47
Association Rule Discovery: Definition
• Given a set of records each of which contain some number of
items from a given collection;
– Produce dependency rules which will predict occurrence
of an item based on occurrences of other items.
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}
48
Association Rule Discovery: Application 1
• Marketing and Sales Promotion:
– Let the rule discovered be
{Bagels, … } --> {Potato Chips}
– Potato Chips as consequent => Can be used to
determine what should be done to boost its sales.
– Bagels in the antecedent => Can be used to see
which products would be affected if the store
discontinues selling bagels.
– Bagels in antecedent and Potato chips in
consequent => Can be used to see what products
should be sold with Bagels to promote sale of
Potato chips!
49
Association Rule Discovery: Application 2
• Supermarket shelf management.
– Goal: To identify items that are
bought together by sufficiently many
customers.
– Approach: Process the point-of-sale
data collected with barcode scanners
to find dependencies among items.
– A classic rule -• If a customer buys diaper and milk, then
he is very likely to buy beer.
• So, don’t be surprised if you find sixpacks stacked next to diapers!
50
Sequential Pattern Discovery: Definition
• Given is a set of objects, with each object associated with its own timeline
of events, find rules that predict strong sequential dependencies among
different events.
(A B)
(C)
(D E)
• Rules are formed by first discovering patterns. Event occurrences in the
patterns are governed by timing constraints.
(A B)
<= xg
(C)
(D E)
>ng <= ws
<= ms
51
Deviation/Anomaly Detection
• Detect significant deviations from normal behavior
• Applications:
– Credit Card Fraud Detection
– Network Intrusion
Detection
Typical network traffic at University level may reach over 100 million connections per day
52
Are All the “Discovered” Patterns
Interesting?
• A data mining system/query may generate thousands of patterns, not all of them
are interesting.
– Suggested approach: Human-centered, query-based, focused mining
• Interestingness measures: A pattern is interesting if it is easily understood by
humans, valid on new or test data with some degree of certainty, potentially useful,
novel, or validates some hypothesis that a user seeks to confirm
• Objective vs. subjective interestingness measures:
– Objective: based on statistics and structures of patterns, e.g., support, confidence, etc.
– Subjective: based on user’s belief in the data, e.g., unexpectedness, novelty,
actionability, etc.
53
Challenges of Data Mining
•
•
•
•
•
•
•
Scalability
Dimensionality
Complex and Heterogeneous Data
Data Quality
Data Ownership and Distribution
Privacy Preservation
Streaming Data
54