Some of these slides are taken
with some modifications from:
Data Mining:
Concepts and Techniques
©Jiawei Han and Micheline Kamber
Intelligent Database Systems Research Lab
School of Computing Science
Simon Fraser University, Canada
http://www.cs.sfu.ca
October 3, 2015
1
Acknowledgements

This work on this set of slides started with Han’s tutorial
for UCLA Extension course in February 1998

Dr. Hongjun Lu from Hong Kong Univ. of Science and
Technology taught jointly with me a Data Mining Summer
Course in Shanghai, China in July 1998. He has
contributed many excellent slides to it

Some graduate students have contributed many new
slides in the following years. Notable contributors include
Eugene Belchev, Jian Pei, and Osmar R. Zaiane (now
teaching in Univ. of Alberta).
October 3, 2015
2
Where to Find More Slides?

Tutorial sections (MS PowerPoint files):


Other conference presentation slides (.ppt):


http://www.cs.sfu.ca/~han/dmbook
http://db.cs.sfu.ca/ or http://www.cs.sfu.ca/~han
Research papers, DBMiner system, and other related
information:

http://db.cs.sfu.ca/ or http://www.cs.sfu.ca/~han
October 3, 2015
3
Introduction

Motivation: Why data mining?

What is data mining?

Data Mining: On what kind of data?

Data mining functionality

Are all the patterns interesting?

Classification of data mining systems

Major issues in data mining
October 3, 2015
4
Motivation: “Necessity is the
Mother of Invention”

Data explosion problem

Automated data collection tools and mature database technology
lead to tremendous amounts of data stored in databases, data
warehouses and other information repositories

We are drowning in data, but starving for knowledge!

Solution: Data warehousing and data mining

Data warehousing and on-line analytical processing

Extraction of interesting knowledge (rules, regularities, patterns,
constraints) from data in large databases
October 3, 2015
5
Evolution of Database Technology

1960s:


1970s:


Relational data model, relational DBMS implementation
1980s:


Data collection, database creation, IMS and network DBMS
RDBMS, advanced data models (extended-relational, OO,
deductive, etc.) and application-oriented DBMS (spatial, scientific,
engineering, etc.)
1990s—2000s:

Data mining and data warehousing, multimedia databases, and
Web databases
October 3, 2015
6
What Is Data Mining?

Data mining (knowledge discovery in databases):


Alternative names and their “inside stories”:



Extraction of interesting (non-trivial, implicit, previously
unknown and potentially useful) information or patterns
from data in large databases
Data mining: a misnomer?
Knowledge discovery(mining) in databases (KDD),
knowledge extraction, data/pattern analysis, data
archeology, data dredging, information harvesting,
business intelligence, etc.
Not data mining if it


October 3, 2015
handles only small amounts of data
retrieves data in answer to queries
7
Why Data Mining? — Potential
Applications

Database analysis and decision support

Market analysis and management


Risk analysis and management



customer relation management, market basket analysis
Forecasting, quality control, competitive analysis
Fraud detection and management
Other Applications

Text mining (news group, email, documents) and Web analysis.

Intelligent query answering
October 3, 2015
8
Market Analysis and Management

Where are the data sources for analysis?


Credit card transactions, clickstreams, customer forms, shopping baskets
Target marketing

Clusters of “model” customers with same characteristics: interest, income level

Determine customer purchasing patterns over time

Cross-market analysis


Customer profiling


Identify associations between product sales, use to predict purchases
what types of customers buy what products? (clustering or classification)
Identifying customer requirements

identify best products for different customers, predict factors to attract new
customers
October 3, 2015
9
Other Applications

Sports


Astronomy


IBM Advanced Scout analyzed NBA game statistics (shots
blocked, assists, and fouls) to gain competitive advantage for
New York Knicks and Miami Heat
JPL and the Palomar Observatory discovered 22 quasars with
the help of data mining
Medical Research

October 3, 2015
Large insurance companies use data mining to study questions
such as the effectiveness of various kinds of antibiotic in
reducing recurrent infections
10
Data Mining: A KDD Process
Pattern Evaluation

Data mining: the core of
knowledge discovery
Data Mining
process.
Task-relevant Data
Data Warehouse
Selection
Data Cleaning
Data Integration
Databases
October 3, 2015
11
Steps of a KDD Process

Learning the application domain:




Creating a target data set: data selection
Data cleaning and preprocessing: (may take 60% of effort!)
Data reduction and transformation:




summarization, classification, regression, association, clustering.
Choosing the mining algorithm(s)
Data mining: search for patterns of interest
Pattern evaluation and knowledge presentation


Find useful features, dimensionality/variable reduction, invariant
representation.
Choosing functions of data mining


relevant prior knowledge and goals of application
visualization, transformation, removing redundant patterns, etc.
Use of discovered knowledge
October 3, 2015
12
Data Mining and Business
Intelligence
Increasing potential
to support
business decisions
Making
Decisions
Data Presentation
Visualization Techniques
Data Mining
Information Discovery
End User
Business
Analyst
Data
Analyst
Data Exploration
Statistical Analysis, Querying and Reporting
Data Warehouses / Data Marts
OLAP, MDA
Data Sources
Paper, Files, Information Providers, Database Systems, OLTP
October 3, 2015
DBA
13
Architecture of a Typical Data
Mining System
Graphical user interface
Pattern evaluation
Data mining engine
Knowledge-base
Database or data
warehouse server
Data cleaning & data integration
Databases
October 3, 2015
Filtering
Data
Warehouse
14
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
Time-series data and temporal data
Text databases and multimedia databases
Heterogeneous and legacy databases
WWW
October 3, 2015
15
Data Mining Functionalities (1)

Concept description: Characterization and
discrimination


Generalize, summarize, and contrast data
characteristics, e.g., dry vs. wet regions
Association (correlation and causality)



Multi-dimensional vs. single-dimensional association
age(X, “20..29”) ^ income(X, “20..29K”)  buys(X,
“PC”) [support = 2%, confidence = 60%]
contains(T, “computer”)  contains(x, “software”) [1%,
75%]
October 3, 2015
16
Data Mining Functionalities (2)


Classification and Prediction

Finding models (functions) that describe and distinguish classes
or concepts for future prediction

E.g., classify countries based on climate, or classify cars based
on gas mileage

Presentation: decision-tree, classification rule, neural network

Prediction: Predict some unknown or missing numerical values
Cluster analysis

Class label is unknown: Group data to form new classes, e.g.,
cluster houses to find distribution patterns

Clustering based on the principle: maximizing the intra-class
similarity and minimizing the interclass similarity
October 3, 2015
17
Data Mining Functionalities (3)

Outlier analysis

Outlier: a data object that does not comply with the general behavior of
the data

It can be considered as noise or exception but is quite useful in fraud
detection, rare events analysis


Trend and evolution analysis

Trend and deviation: regression analysis

Sequential pattern mining, periodicity analysis

Similarity-based analysis
Other pattern-directed or statistical analyses
October 3, 2015
18
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.
October 3, 2015
19
Can We Find All and Only
Interesting Patterns?


Find all the interesting patterns: Completeness

Can a data mining system find all the interesting patterns?

Association vs. classification vs. clustering
Search for only interesting patterns: Optimization

Can a data mining system find only the interesting patterns?

Approaches


October 3, 2015
First generate all the patterns and then filter out the
uninteresting ones.
Generate only the interesting patterns—mining query
optimization
20
Data Mining: Confluence of Multiple
Disciplines
Database
Technology
Machine
Learning
Information
Science
October 3, 2015
Statistics
Data Mining
Visualization
Other
Disciplines
21
Data Mining: Classification
Schemes


General functionality

Descriptive data mining

Predictive data mining
Different views, different classifications

Kinds of databases to be mined

Kinds of knowledge to be discovered

Kinds of techniques utilized

Kinds of applications adapted
October 3, 2015
22
A Multi-Dimensional View of Data
Mining Classification




Databases to be mined
 Relational, transactional, object-oriented, object-relational,
active, spatial, time-series, text, multi-media, heterogeneous,
legacy, WWW, etc.
Knowledge to be mined
 Characterization, discrimination, association, classification,
clustering, trend, deviation and outlier analysis, etc.
 Multiple/integrated functions and mining at multiple levels
Techniques utilized
 Database-oriented, data warehouse (OLAP), machine learning,
statistics, visualization, neural network, etc.
Applications adapted

Retail, telecommunication, banking, fraud analysis, DNA mining, stock
market analysis, Web mining, Weblog analysis, etc.
October 3, 2015
23
Major Issues in Data Mining (1)


Mining methodology and user interaction

Mining different kinds of knowledge in databases

Interactive mining of knowledge at multiple levels of abstraction

Incorporation of background knowledge

Data mining query languages and ad-hoc data mining

Expression and visualization of data mining results

Handling noise and incomplete data

Pattern evaluation: the interestingness problem
Performance and scalability

Efficiency and scalability of data mining algorithms

Parallel, distributed and incremental mining methods
October 3, 2015
24
Major Issues in Data Mining (2)

Issues relating to the diversity of data types



Handling relational and complex types of data
Mining information from heterogeneous databases and global
information systems (WWW)
Issues related to applications and social impacts



Application of discovered knowledge
 Domain-specific data mining tools
 Intelligent query answering
 Process control and decision making
Integration of the discovered knowledge with existing knowledge:
A knowledge fusion problem
Protection of data security, integrity, and privacy
October 3, 2015
25
Summary

Data mining: discovering interesting patterns from large amounts of
data

A natural evolution of database technology, in great demand, with
wide applications

A KDD process includes data cleaning, data integration, data
selection, transformation, data mining, pattern evaluation, and
knowledge presentation

Mining can be performed in a variety of information repositories

Data mining functionalities: characterization, discrimination,
association, classification, clustering, outlier and trend analysis, etc.

Classification of data mining systems

Major issues in data mining
October 3, 2015
26
Where to Find References?

Data mining and KDD:



Database field:




Conference proceedings: Machine learning, AAAI, IJCAI, etc.
Journals: Machine Learning, Artificial Intelligence, etc.
Statistics:



Conference proceedings: ACM-SIGMOD, ACM-PODS, VLDB, ICDE,
EDBT, DASFAA
Journals: ACM-TODS, J. ACM, IEEE-TKDE, JIIS, etc.
AI and Machine Learning:


Conference proceedings: KDD, and others, such as PKDD, PAKDD, etc.
Journal: Data Mining and Knowledge Discovery
Conference proceedings: Joint Stat. Meeting, etc.
Journals: Annals of statistics, etc.
Visualization:


Conference proceedings: CHI, etc.
Journals: IEEE Trans. visualization and computer graphics, etc.
October 3, 2015
27
References

U. M. Fayyad, G. Piatetsky-Shapiro, P. Smyth, and R. Uthurusamy. Advances in
Knowledge Discovery and Data Mining. AAAI/MIT Press, 1996.

J. Han and M. Kamber. Data Mining: Concepts and Techniques. Morgan
Kaufmann, 2000.

T. Imielinski and H. Mannila. A database perspective on knowledge discovery.
Communications of ACM, 39:58-64, 1996.

G. Piatetsky-Shapiro, U. Fayyad, and P. Smith. From data mining to knowledge
discovery: An overview. In U.M. Fayyad, et al. (eds.), Advances in Knowledge
Discovery and Data Mining, 1-35. AAAI/MIT Press, 1996.

G. Piatetsky-Shapiro and W. J. Frawley. Knowledge Discovery in Databases.
AAAI/MIT Press, 1991.
October 3, 2015
28
Data Mining for Web Sites
October 3, 2015
29
29
Data Mining for Web Sites



Clickstream Mining
KDD Cup
Mining site databases
October 3, 2015
30
Clickstream Mining

Kinds of data available




Raw Data
Aggregations and Cleanup
Kinds of questions you can ask
Some of the cautions
October 3, 2015
31
Clickstream Mining

What is a clickstream?


The record of every page request from
every visitor to your site
What does it typically contain?






Date/time of the page request
IP address of visitor
Page object being requested (whole page or a
frame, image, etc.)
Type of request (get, submit)
Referrer
Browser making request
October 3, 2015
32
Data Cleaning

Eliminate search engines and bots?
They follow atypical patterns through a site





Eliminate internal testers?


Can’t typically do by IP address.
Many hits within a very short time period
exactly one hit on each link with a depth first or breadth-first
pattern
Hits at the same time every day, at unusual times.
Typically can do by IP address. Harder if both developers
and customers are internal and addressing is dynamic.
Eliminate certain sites?


October 3, 2015
AOL reassigns IP at every request
Previous experience suggests that you get a lot of valueless
hits from, e.g., the .edu domain.
33
Aggregations/Dimensions

Aggregate or process individual log
requests to get richer dimensions





October 3, 2015
Date and Time
Visitors
Page object
Session
Path
34
Some Aggregations

Date and Time




Separate them!
Reference to standard such as GMT
If multiple servers, need very accurate
synchronization
Visitors



October 3, 2015
anonymous, by IP only. Track within one session
(probably)
Cookie. Track visitor within one session reliably,
possibly across sessions
Registration. Have some significant data. Name,
email address, etc.
35
Some More Aggregations

Page object.



Session




Group together objects on one “page”. Frames, images
Add meta-information/page characteristics if available. DB-based,
portal-based, XML-based web-sites.
One “visit” by a user
Typically, all connections from the same IP address without a gap
of at least a certain length.
Login to logout or timeout of you require login.
Path

October 3, 2015
Sequence of pages visited during one session by one visitor
36
What’s It Good For?

Kinds of questions you can answer solely through
clickstream data







On what pages did people spend a relatively long time?
What was the last page typically viewed? Did people follow
“recommender” links?
Where did referrals come from?
Where did referrals who spent significant time come from?
Mostly questions about the web site itself
Mostly descriptive statistics with relatively simple
analyses once the cleanup and aggregation is done
Interpreting the answers to the questions requires an
understanding of the domain
October 3, 2015
37
Some cautions




Visitor Counts: DHCP, caching, AOL
Session definition: false positives AND negatives
Path through site: caching and “go” menu
“Time on site”: count UP TO last request, but not
time on last page.
October 3, 2015
38
KDD Cup




Annual challenge problem at the ACM KDD
conference.
In 2000, it involved clickstream mining.
In 2001,

Prediction of Molecular Bioactivity for Drug Design

Prediction of Gene/Protein Function and Localization
In 2002,

Task 1: Information Extraction from Biomedical Articles

Task 2: Yeast Gene Regulation Prediction
October 3, 2015
39
KDD Cup, 2000

Five questions:
Given a set of page views, will the visitor view another page
on the site or will the visitor leave?
 Given a set of page views, which product brand will the
visitor view in the remainder of the session?
 Given a set of purchases over a period of time, characterize
visitors who spend more than $12 (order amount) on an
average order at the site.
 Given a set of page views, characterize killer pages, i.e.,
pages after which users leave the site.
 Given a set of page views, characterize which product brand
a visitor will view in the remainder of the session?
http://www.ecn.purdue.edu/KDDCUP/
http://robotics.Stanford.EDU/~ronnyk/kddCupTalk.ppt



October 3, 2015
40
Other Kinds of Data Mining For
the Web
October 3, 2015
41
41
Site Databases




Kinds of data available
Data cleanup and aggregation a lot easier
Kinds of questions you might ask
Recommender systems



Collaborative filtering
Simple correlations
Can get really fancy: Amazon
October 3, 2015
42
Kinds of Data Available

User data elicited from user:




Enriched User Data (e.g., Acxiom Infobase)






Ordering information
Preferences, likes, dislikes
Personal information such as name, address, credit card
age
gender
marital status
vehicle lifestyle
own/rent
Product Data
October 3, 2015
43
Kinds of Questions



What were typical items purchased?
What were typical items purchased by high
spenders?
For people who chose X, what else might they
like?


Based on known characteristics
Based on statistical patterns
October 3, 2015
44
Combining Data


Using just clickstream data can give you some
information relevant to a website.
Additional questions available if you combine:



Clickstream
Site Databases
Enriched data from other databases
October 3, 2015
45
Kinds of Questions



What are general characteristics of people who
spend a lot of time on the site? (e.g., educational
level)
Which pages are visited by people who actually buy?
Which referring sites lead to purchases, and which to
“curiosity” visits?
October 3, 2015
46
Issues, Concerns

Merging data



Just about requires login. So when do you require it?
Cookies may be misleading. One user, multiple
systems; one system, multiple users
Need to know domain, to interpret results
October 3, 2015
47
Recommender Systems





Very common addition to e-commerce sites
Editorial recommenders
Content Filtering Recommenders
Collaborative Filtering Recommenders
Hybrids
October 3, 2015
48
Editorial Filtering



Recommendations made by a person
Not new, obviously
Web has made them much more accessible





Most prevalent for media: books, movies, CDs
Advantages:



www.imdb.com. Movie reviews
mysteryguide.com. Mystery book reviews
Search, browse capabilities
Detailed, "accurate" reviews.
Add context
Disadvantages



Coverage is limited
No personalization
Some areas (e.g., travel) heavily dominated by commercial sites
October 3, 2015
49
Content Filtering


Find documents "like this one"
Attributes for comparison can be
meta-data
 author
 subject
 director
These are typically simple statistics
 document content
 bag-of-words, vectors
 keywords
All the categorization techniques we have discussed

October 3, 2015
50
Collaborative Filtering


DB of user ratings/preferences. Explicit or inferred
from purchases
For case to be predicted or recommended




Can use other algorithms for choosing cases to
predict from. (e.g., neural nets)



Determine nearest neighbors based on known shared data
Weight neighbors’ choices based on “nearness”.
Return top predictions or recommendations
All assume some dimensions on which we have (probably
incomplete) data for each case.
All are automatic, not involving human judgment
Lyle Ungar has an excellent set of links:
http://www.cis.upenn.edu/~ungar/CF/
October 3, 2015
51
Amazon recommender systems






Rich set of recommendations using multiple
techniques
Content Filtering: Books like this, authors like this:
straight descriptive statistics. (Caution: control for
overall frequency?)
Collaborative filtering: individual recommendations,
based on purchases and ratings
Editorial Filtering: Lists provided by users.
Hybrid: Best Seller lists, current rank of books.
Access recommender system directly:
 I own it
 Rate it
 Not interested
 exclude this item
 why was this recommended?
October 3, 2015
52
Tuning Amazon's Recommender
System


Individual recommendations are based on
purchases and ratings.
Access recommender system directly:






I own it
Rate it
Not interested
exclude this item
add this item
Why was this recommended?
October 3, 2015
53
Web Privacy
October 3, 2015
54
Introduction

Privacy is a significant issue




On the web
 Who knows what about you?
 What are they doing with it
For data mining
 Who has collected data on you (not just on the web)
 Why did they collect it?
 What else are they entitled to do with it?
Who owns data about you?
How can society best control privacy abuses?


October 3, 2015
Voluntary compliance and market forces?
Government regulation?
55
Homework Assignment
1. How many clicks from the home page did it take you to reach the
privacy policy?
2. What information do they collect? For what is it used?
3. With whom do they share information?
4. If they change their policy how are you notified?
5. Can you ask that information maintained be limited? How?
6. Can you see what information is maintained about you? Ask that
information be removed? Ask that it be corrected? How?
October 3, 2015
56
Who Knows What about You?





Clickstreams and
Cookies
Brief overview of some of what’s out there, just to
get you thinking :-)
http://www.privacy.net/analyze/
http://www.junkbusters.com/ht/en/cookies.html
October 3, 2015
57
How Do We Control It?

The US has tended toward technical, marketplace and voluntary
standards.





The European Union has passed the EU Data Privacy Directive.



Patchwork of state and local laws.
Several laws proposed at the national level, but none has passed
Serious Freedom of Speech concerns, both directions
Much industrial pressure to keep voluntary
Articles 25 and 26 prohibit exchanging data with countries which do not
comply
http://www.cdt.org/privacy/eudirective/EU_Directive_.html
U.S.has proposed a Safe Harbor

register and be certified as complying with safe harbor provisions
If certified, acceptable as alternative for EU data exchange

http://www.exports.gov/safeharbor/

October 3, 2015
58
Safe Harbor Provisions







In place
Gradually being adopted; 156 organizations listed,
compared to 30 a year ago.
Continues to be debated; 156 is miniscule!
Both enforcement of Safe Harbor compliance and EU
enforcement still issues
http://www.europemedia.net/showfeature.asp?ArticleID=8608
http://www.house.gov/commerce/hearings/03082001-49/08082001.htm
http://www.useu.be/ISSUES/over0817.html
October 3, 2015
59
Safe Harbor Provisions







October 3, 2015
Notice
Choice
Onward Transfer (Transfers to Third
Parties)
Access
Security
Data integrity
Enforcement
60
Notice

Notice: Organizations must notify individuals about the
purposes for which they collect and use information about
them. They must provide information about how individuals
can contact the organization with any inquiries or
complaints, the types of third parties to which it discloses
the information and the choices and means the
organization offers for limiting its use and disclosure.
October 3, 2015
61
Choice

Choice: Organizations must give individuals the
opportunity to choose (opt out) whether their personal
information is to be disclosed to a third party or to be used
for a purpose incompatible with the purpose for which it
was originally collected or subsequently authorized by the
individual. For sensitive information, affirmative or explicit
(opt in) choice must be given if the information is to be
disclosed to a third party or used for a purpose other than
its original purpose or the purpose authorized
subsequently by the individual.
October 3, 2015
62
Onward Transfer

Onward Transfer (Transfers to Third Parties): To
disclose information to a third party, organizations must
apply the notice and choice principles. Where an
organization wishes to transfer information to a third party
that is acting as an agent(1), it may do so if it makes sure
that the third party subscribes to the safe harbor principles
or is subject to the Directive or another adequacy finding.
As an alternative, the organization can enter into a written
agreement with such third party requiring that the third
party provide at least the same level of privacy protection
as is required by the relevant principles.
October 3, 2015
63
Access

Access: Individuals must have access to personal
information about them that an organization holds and be
able to correct, amend, or delete that information where it
is inaccurate, except where the burden or expense of
providing access would be disproportionate to the risks to
the individual's privacy in the case in question, or where
the rights of persons other than the individual would be
violated.
October 3, 2015
64
Security

Security: Organizations must take reasonable precautions
to protect personal information from loss, misuse and
unauthorized access, disclosure, alteration and
destruction.
October 3, 2015
65
Data Integrity

Data integrity: Personal information must be relevant for
the purposes for which it is to be used. An organization
should take reasonable steps to ensure that data is reliable
for its intended use, accurate, complete, and current.
October 3, 2015
66
Enforcement

Enforcement: In order to ensure compliance with the
safe harbor principles, there must be (a) readily
available and affordable independent recourse
mechanisms so that each individual's complaints and
disputes can be investigated and resolved and damages
awarded where the applicable law or private sector
initiatives so provide; (b) procedures for verifying that
the commitments companies make to adhere to the safe
harbor principles have been implemented; and (c)
obligations to remedy problems arising out of a failure to
comply with the principles. Sanctions must be
sufficiently rigorous to ensure compliance by the
organization. Organizations that fail to provide annual
self certification letters will no longer appear in the list of
participants and safe harbor benefits will no longer be
assured.
October 3, 2015
67
What do YOU think?

Do you think the policy for your web pages is
adequately described? Reasonable?

How you would implement privacy as a web
designer?

What are your concerns as a web user?
October 3, 2015
68
Descargar

Mining Frequent Patterns Without Candidate Generation