Introduction to Data Mining
Why Mine Data? Commercial Viewpoint
• Lots of data is being collected
and warehoused
– Web data, e-commerce
– purchases at department/
grocery stores
– Bank/Credit Card
transactions
• Twice as much information was created in 2002 as in 1999 (~30% growth rate)
• Other growth rate estimates even higher
Largest databases in 2007
• Largest database in the world: World Data Centre for Climate
(WDCC) operated by the Max Planck Institute and German
Climate Computing Centre
– 220 terabytes of data on climate research and climatic trends,
– 110 terabytes worth of climate simulation data.
– 6 petabytes worth of additional information stored on tapes.
• AT&T
– 323 terabytes of information
– 1.9 trillion phone call records
• Google
– 91 million searches per day,
• After a year worth of searches, this figure amounts to more than 33
trillion database entries.
Why Mine Data? Scientific Viewpoint
• Data is collected and stored at
enormous speeds (GB/hour). E.g.
– remote sensors on a satellite
– telescopes scanning the skies
– scientific simulations
generating terabytes of data
• Very little data will ever be looked at
by a human
• Knowledge Discovery is NEEDED
to make sense and use of data.
Data Mining
• Data mining is the process of automatically discovering useful
information in large data repositories.
• Human analysts may take weeks to discover useful information.
• Much of the data is never analyzed at all.
0
500,000
1,000,000
1,500,000
2,000,000
2,500,000
3,000,000
3,500,000
4,000,000
1995 1996 1997 1998 1999
The Data Gap
Total new disk (TB) since 1995
Number of
analysts
From: R. Grossman, C. Kamath, V. Kumar, “Data Mining for Scientific and Engineering Applications”
What is (not) Data Mining?
 What is Data Mining?
– Certain names are more
prevalent in certain locations
(O’Brien, O’Rurke, O’Reilly…
in Boston area)
–Discover groups of similar
documents on the Web
 What is not Data
Mining?
– Look up phone
number in phone
directory
– Query a Web
search engine for
information about
“Amazon”
• Draws ideas from: machine learning/AI, statistics, and database
systems
Origins of Data Mining
Machine Learning
Statistics
Data Mining
Database
systems
Data Mining Tasks
Data mining tasks are generally divided into two major categories:
• Predictive tasks [Use some attributes to predict unknown or future
values of other attributes.]
• Classification
• Regression
• Deviation Detection
• Descriptive tasks [Find human-interpretable patterns that describe the
data.]
• Association Discovery
• Clustering
Predictive Data Mining or
Supervised learning
• Given a collection of records (training set)
– Each record contains a set of attributes; one of the attributes is the class.
• Find ("learn") a model for the class attribute as a function of the
values of the other attributes.
• Goal: previously unseen records should be assigned a class as
accurately as possible.
Learning
We can think of at least three different problems being involved in
learning:
• memory,
• averaging, and
• generalization.
Example problem
(Adapted from Leslie Kaelbling's example in the MIT courseware)
• Imagine that I'm trying to predict whether my neighbor is going to
drive to work so I can ask for a ride.
• Whether she drives to work seems to depend on the following
attributes of the day:
– temperature,
– expected precipitation,
– day of the week,
– what she's wearing.
Memory
• Okay. Let's say we observe our neighbor on three days:
Clothes
Shop
Day
Precip
Temp
Walk
Casual
No
Sat
None
25
Drive
Casual
Yes
Mon
Snow
-5
Walk
Casual
Yes
Mon
Snow
15
Memory
• Now, we find ourselves on a snowy “–5” – degree Monday, when
the neighbor is wearing casual clothes and going shopping.
• Do you think she's going to drive?
Temp Precip Day Clothes
25 None Sat Casual Walk
-5 Snow Mon Casual Drive
15 Snow Mon Casual Walk
-5 Snow Mon Casual
Memory
• The standard answer in this case is "yes".
– This day is just like one of the ones we've seen before, and so it
seems like a good bet to predict "yes."
• This is about the most rudimentary form of learning, which is just
to memorize the things you've seen before.
Temp Precip Day Clothes
25 None Sat Casual Walk
-5 Snow Mon Casual Drive
15 Snow Mon Casual Walk
-5 Snow Mon Casual Drive
Noisy Data
• Things aren’t always as easy as they were in the previous case. What if
you get this set of noisy data?
Temp Precip Day Clothes
25 None Sat Casual Walk
25 None Sat Casual Walk
25 None Sat Casual Drive
25 None Sat Casual Drive
25 None Sat Casual Walk
25 None Sat Casual Walk
25 None Sat Casual Walk
25 None Sat Casual ?
• Now, we are asked to predict what's going to happen.
• We have certainly seen this case before.
• But the problem is that it has had different answers. Our neighbor is
not entirely reliable.
Averaging
• One strategy would be to predict the majority outcome.
– The neighbor walked more times than she drove in this situation, so
we might predict "walk".
Temp Precip Day Clothes
25 None Sat Casual Walk
25 None Sat Casual Walk
25 None Sat Casual Drive
25 None Sat Casual Drive
25 None Sat Casual Walk
25 None Sat Casual Walk
25 None Sat Casual Walk
25 None Sat Casual Walk
Generalization
• Dealing with previously unseen cases
• Will she walk or drive?
Temp Precip Day Clothes
22 None Fri Casual Walk
3 None Sun Casual Walk
10 Rain Wed Casual Walk
30 None Mon Casual Drive
20 None Sat Formal Drive
25 None Sat Casual Drive
-5 Snow Mon Casual Drive
27 None Tue Casual Drive
24 Rain Mon Casual ?
• We might plausibly
make any of the
following arguments:
– She's going to
walk because it's
raining today and
the only other time
it rained, she
walked.
– She's going to
drive because she
has always driven
on Mondays…
Classification Another Example
Tid Refund Marital
Status
Taxable
Income Cheat
1 Yes Single 125K No
2 No Married 100K No
3 No Single 70K No
4 Yes Married 120K No
5 No Divorced 95K Yes
6 No Married 60K No
7 Yes Divorced 220K No
8 No Single 85K Yes
9 No Married 75K No
10 No Single 90K Yes
10
Refund Marital
Status
Taxable
Income Cheat
No Single 75K ?
Yes Married 50K ?
No Married 150K ?
Yes Divorced 90K ?
No Single 40K ?
No Married 80K ?
10
Test
Set
Training
Set
Model
Learn
Classifier
Example of a Decision Tree
Tid Refund Marital
Status
Taxable
Income Cheat
1 Yes Single 125K No
2 No Married 100K No
3 No Single 70K No
4 Yes Married 120K No
5 No Divorced 95K Yes
6 No Married 60K No
7 Yes Divorced 220K No
8 No Single 85K Yes
9 No Married 75K No
10 No Single 90K Yes
10
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Splitting Attributes
Training Data Model: Decision Tree
Apply Model to Test Data
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Refund Marital
Status
Taxable
Income Cheat
No Married 80K ?
10
Test Data
Start from the root of tree.
Apply Model to Test Data
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Refund Marital
Status
Taxable
Income Cheat
No Married 80K ?
10
Test Data
Apply Model to Test Data
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Refund Marital
Status
Taxable
Income Cheat
No Married 80K ?
10
Test Data
Apply Model to Test Data
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Refund Marital
Status
Taxable
Income Cheat
No Married 80K ?
10
Test Data
Apply Model to Test Data
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Refund Marital
Status
Taxable
Income Cheat
No Married 80K ?
10
Test Data
Apply Model to Test Data
Refund
MarSt
TaxInc
YES
NO
NO
NO
Yes No
Married
Single, Divorced
< 80K > 80K
Refund Marital
Status
Taxable
Income Cheat
No Married 80K ?
10
Test Data
Assign Cheat to “No”

Introduction to Data Mining (Why Mine Data? Commercial Viewpoint)

  • 1.
  • 2.
    Why Mine Data?Commercial Viewpoint • Lots of data is being collected and warehoused – Web data, e-commerce – purchases at department/ grocery stores – Bank/Credit Card transactions • Twice as much information was created in 2002 as in 1999 (~30% growth rate) • Other growth rate estimates even higher
  • 3.
    Largest databases in2007 • Largest database in the world: World Data Centre for Climate (WDCC) operated by the Max Planck Institute and German Climate Computing Centre – 220 terabytes of data on climate research and climatic trends, – 110 terabytes worth of climate simulation data. – 6 petabytes worth of additional information stored on tapes. • AT&T – 323 terabytes of information – 1.9 trillion phone call records • Google – 91 million searches per day, • After a year worth of searches, this figure amounts to more than 33 trillion database entries.
  • 4.
    Why Mine Data?Scientific Viewpoint • Data is collected and stored at enormous speeds (GB/hour). E.g. – remote sensors on a satellite – telescopes scanning the skies – scientific simulations generating terabytes of data • Very little data will ever be looked at by a human • Knowledge Discovery is NEEDED to make sense and use of data.
  • 5.
    Data Mining • Datamining is the process of automatically discovering useful information in large data repositories. • Human analysts may take weeks to discover useful information. • Much of the data is never analyzed at all. 0 500,000 1,000,000 1,500,000 2,000,000 2,500,000 3,000,000 3,500,000 4,000,000 1995 1996 1997 1998 1999 The Data Gap Total new disk (TB) since 1995 Number of analysts From: R. Grossman, C. Kamath, V. Kumar, “Data Mining for Scientific and Engineering Applications”
  • 6.
    What is (not)Data Mining?  What is Data Mining? – Certain names are more prevalent in certain locations (O’Brien, O’Rurke, O’Reilly… in Boston area) –Discover groups of similar documents on the Web  What is not Data Mining? – Look up phone number in phone directory – Query a Web search engine for information about “Amazon”
  • 7.
    • Draws ideasfrom: machine learning/AI, statistics, and database systems Origins of Data Mining Machine Learning Statistics Data Mining Database systems
  • 8.
    Data Mining Tasks Datamining tasks are generally divided into two major categories: • Predictive tasks [Use some attributes to predict unknown or future values of other attributes.] • Classification • Regression • Deviation Detection • Descriptive tasks [Find human-interpretable patterns that describe the data.] • Association Discovery • Clustering
  • 9.
    Predictive Data Miningor Supervised learning • Given a collection of records (training set) – Each record contains a set of attributes; one of the attributes is the class. • Find ("learn") a model for the class attribute as a function of the values of the other attributes. • Goal: previously unseen records should be assigned a class as accurately as possible.
  • 10.
    Learning We can thinkof at least three different problems being involved in learning: • memory, • averaging, and • generalization.
  • 11.
    Example problem (Adapted fromLeslie Kaelbling's example in the MIT courseware) • Imagine that I'm trying to predict whether my neighbor is going to drive to work so I can ask for a ride. • Whether she drives to work seems to depend on the following attributes of the day: – temperature, – expected precipitation, – day of the week, – what she's wearing.
  • 12.
    Memory • Okay. Let'ssay we observe our neighbor on three days: Clothes Shop Day Precip Temp Walk Casual No Sat None 25 Drive Casual Yes Mon Snow -5 Walk Casual Yes Mon Snow 15
  • 13.
    Memory • Now, wefind ourselves on a snowy “–5” – degree Monday, when the neighbor is wearing casual clothes and going shopping. • Do you think she's going to drive? Temp Precip Day Clothes 25 None Sat Casual Walk -5 Snow Mon Casual Drive 15 Snow Mon Casual Walk -5 Snow Mon Casual
  • 14.
    Memory • The standardanswer in this case is "yes". – This day is just like one of the ones we've seen before, and so it seems like a good bet to predict "yes." • This is about the most rudimentary form of learning, which is just to memorize the things you've seen before. Temp Precip Day Clothes 25 None Sat Casual Walk -5 Snow Mon Casual Drive 15 Snow Mon Casual Walk -5 Snow Mon Casual Drive
  • 15.
    Noisy Data • Thingsaren’t always as easy as they were in the previous case. What if you get this set of noisy data? Temp Precip Day Clothes 25 None Sat Casual Walk 25 None Sat Casual Walk 25 None Sat Casual Drive 25 None Sat Casual Drive 25 None Sat Casual Walk 25 None Sat Casual Walk 25 None Sat Casual Walk 25 None Sat Casual ? • Now, we are asked to predict what's going to happen. • We have certainly seen this case before. • But the problem is that it has had different answers. Our neighbor is not entirely reliable.
  • 16.
    Averaging • One strategywould be to predict the majority outcome. – The neighbor walked more times than she drove in this situation, so we might predict "walk". Temp Precip Day Clothes 25 None Sat Casual Walk 25 None Sat Casual Walk 25 None Sat Casual Drive 25 None Sat Casual Drive 25 None Sat Casual Walk 25 None Sat Casual Walk 25 None Sat Casual Walk 25 None Sat Casual Walk
  • 17.
    Generalization • Dealing withpreviously unseen cases • Will she walk or drive? Temp Precip Day Clothes 22 None Fri Casual Walk 3 None Sun Casual Walk 10 Rain Wed Casual Walk 30 None Mon Casual Drive 20 None Sat Formal Drive 25 None Sat Casual Drive -5 Snow Mon Casual Drive 27 None Tue Casual Drive 24 Rain Mon Casual ? • We might plausibly make any of the following arguments: – She's going to walk because it's raining today and the only other time it rained, she walked. – She's going to drive because she has always driven on Mondays…
  • 18.
    Classification Another Example TidRefund Marital Status Taxable Income Cheat 1 Yes Single 125K No 2 No Married 100K No 3 No Single 70K No 4 Yes Married 120K No 5 No Divorced 95K Yes 6 No Married 60K No 7 Yes Divorced 220K No 8 No Single 85K Yes 9 No Married 75K No 10 No Single 90K Yes 10 Refund Marital Status Taxable Income Cheat No Single 75K ? Yes Married 50K ? No Married 150K ? Yes Divorced 90K ? No Single 40K ? No Married 80K ? 10 Test Set Training Set Model Learn Classifier
  • 19.
    Example of aDecision Tree Tid Refund Marital Status Taxable Income Cheat 1 Yes Single 125K No 2 No Married 100K No 3 No Single 70K No 4 Yes Married 120K No 5 No Divorced 95K Yes 6 No Married 60K No 7 Yes Divorced 220K No 8 No Single 85K Yes 9 No Married 75K No 10 No Single 90K Yes 10 Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Splitting Attributes Training Data Model: Decision Tree
  • 20.
    Apply Model toTest Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Refund Marital Status Taxable Income Cheat No Married 80K ? 10 Test Data Start from the root of tree.
  • 21.
    Apply Model toTest Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Refund Marital Status Taxable Income Cheat No Married 80K ? 10 Test Data
  • 22.
    Apply Model toTest Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Refund Marital Status Taxable Income Cheat No Married 80K ? 10 Test Data
  • 23.
    Apply Model toTest Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Refund Marital Status Taxable Income Cheat No Married 80K ? 10 Test Data
  • 24.
    Apply Model toTest Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Refund Marital Status Taxable Income Cheat No Married 80K ? 10 Test Data
  • 25.
    Apply Model toTest Data Refund MarSt TaxInc YES NO NO NO Yes No Married Single, Divorced < 80K > 80K Refund Marital Status Taxable Income Cheat No Married 80K ? 10 Test Data Assign Cheat to “No”