April 12, 2023 1
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
Some of these slides are taken with some modifications from:
April 12, 2023 2
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).
April 12, 2023 3
Where to Find More Slides?
Tutorial sections (MS PowerPoint files):
http://www.cs.sfu.ca/~han/dmbook
Other conference presentation slides (.ppt):
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
April 12, 2023 4
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
April 12, 2023 5
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
April 12, 2023 6
Evolution of Database Technology
1960s: Data collection, database creation, IMS and network DBMS
1970s: Relational data model, relational DBMS implementation
1980s: 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
April 12, 2023 7
What Is Data Mining?
Data mining (knowledge discovery in databases):
Extraction of interesting (non-trivial, implicit, previously
unknown and potentially useful) information or patterns from data in large databases
Alternative names and their “inside stories”: 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 handles only small amounts of data retrieves data in answer to queries
April 12, 2023 8
Why Data Mining? — Potential Applications
Database analysis and decision support Market analysis and management
customer relation management, market basket analysis
Risk analysis and management
Forecasting, quality control, competitive analysis
Fraud detection and management
Other Applications Text mining (news group, email, documents) and Web analysis.
Intelligent query answering
April 12, 2023 9
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
Identify associations between product sales, use to predict purchases
Customer profiling 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
April 12, 2023 10
Other Applications
Sports IBM Advanced Scout analyzed NBA game statistics (shots
blocked, assists, and fouls) to gain competitive advantage for New York Knicks and Miami Heat
Astronomy JPL and the Palomar Observatory discovered 22 quasars with
the help of data mining
Medical Research Large insurance companies use data mining to study questions
such as the effectiveness of various kinds of antibiotic in reducing recurrent infections
April 12, 2023 11
Data Mining: A KDD Process
Data mining: the core of knowledge discovery process.
Data Cleaning
Data Integration
Databases
Data Warehouse
Task-relevant Data
Selection
Data Mining
Pattern Evaluation
April 12, 2023 12
Steps of a KDD Process
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
April 12, 2023 13
Data Mining and Business Intelligence
Increasing potentialto supportbusiness decisions End User
Business Analyst
DataAnalyst
DBA
MakingDecisions
Data Presentation
Visualization Techniques
Data MiningInformation Discovery
Data Exploration
OLAP, MDA
Statistical Analysis, Querying and Reporting
Data Warehouses / Data Marts
Data SourcesPaper, Files, Information Providers, Database Systems, OLTP
April 12, 2023 14
Architecture of a Typical Data Mining System
Data Warehouse
Data cleaning & data integration Filtering
Databases
Database or data warehouse server
Data mining engine
Pattern evaluation
Graphical user interface
Knowledge-base
April 12, 2023 15
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
April 12, 2023 16
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%]
April 12, 2023 17
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
April 12, 2023 18
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
April 12, 2023 19
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.
April 12, 2023 20
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
First generate all the patterns and then filter out the
uninteresting ones.
Generate only the interesting patterns—mining query
optimization
April 12, 2023 21
Data Mining: Confluence of Multiple Disciplines
Data Mining
Database Technology
Statistics
OtherDisciplines
InformationScience
MachineLearning Visualization
April 12, 2023 22
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
April 12, 2023 23
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.
April 12, 2023 24
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
April 12, 2023 25
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
April 12, 2023 26
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
April 12, 2023 27
Where to Find References?
Data mining and KDD: Conference proceedings: KDD, and others, such as PKDD, PAKDD, etc. Journal: Data Mining and Knowledge Discovery
Database field: 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: Machine learning, AAAI, IJCAI, etc. Journals: Machine Learning, Artificial Intelligence, etc.
Statistics: Conference proceedings: Joint Stat. Meeting, etc. Journals: Annals of statistics, etc.
Visualization: Conference proceedings: CHI, etc. Journals: IEEE Trans. visualization and computer graphics, etc.
April 12, 2023 28
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.
April 12, 2023 2929
Data Mining for Web Sites
April 12, 2023 30
Data Mining for Web Sites
Clickstream Mining KDD Cup Mining site databases
April 12, 2023 31
Clickstream Mining
Kinds of data available Raw Data Aggregations and Cleanup
Kinds of questions you can ask Some of the cautions
April 12, 2023 32
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
April 12, 2023 33
Data Cleaning Eliminate search engines and bots?
They follow atypical patterns through a site 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.
Eliminate internal testers? Typically can do by IP address. Harder if both developers
and customers are internal and addressing is dynamic.
Eliminate certain sites? AOL reassigns IP at every request Previous experience suggests that you get a lot of valueless
hits from, e.g., the .edu domain.
April 12, 2023 34
Aggregations/Dimensions
Aggregate or process individual log requests to get richer dimensions Date and Time Visitors Page object Session Path
April 12, 2023 35
Some Aggregations Date and Time
Separate them! Reference to standard such as GMT If multiple servers, need very accurate
synchronization Visitors
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.
April 12, 2023 36
Some More Aggregations
Page object. Group together objects on one “page”. Frames, images Add meta-information/page characteristics if available. DB-based,
portal-based, XML-based web-sites.
Session 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 Sequence of pages visited during one session by one visitor
April 12, 2023 37
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
April 12, 2023 38
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.
April 12, 2023 39
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
April 12, 2023 40
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
April 12, 2023 4141
Other Kinds of Data Mining For the Web
April 12, 2023 42
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
April 12, 2023 43
Kinds of Data Available User data elicited from user:
Ordering information Preferences, likes, dislikes Personal information such as name, address, credit card
Enriched User Data (e.g., Acxiom Infobase) age gender marital status vehicle lifestyle own/rent
Product Data
April 12, 2023 44
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
April 12, 2023 45
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
April 12, 2023 46
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?
April 12, 2023 47
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
April 12, 2023 48
Recommender Systems Very common addition to e-commerce sites Editorial recommenders Content Filtering Recommenders Collaborative Filtering Recommenders Hybrids
April 12, 2023 49
Editorial Filtering Recommendations made by a person Not new, obviously Web has made them much more accessible
www.imdb.com. Movie reviews mysteryguide.com. Mystery book reviews Search, browse capabilities
Most prevalent for media: books, movies, CDs Advantages:
Detailed, "accurate" reviews. Add context
Disadvantages Coverage is limited No personalization Some areas (e.g., travel) heavily dominated by commercial sites
April 12, 2023 50
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
April 12, 2023 51
Collaborative Filtering DB of user ratings/preferences. Explicit or inferred
from purchases For case to be predicted or recommended
Determine nearest neighbors based on known shared data Weight neighbors’ choices based on “nearness”. Return top predictions or recommendations
Can use other algorithms for choosing cases to predict from. (e.g., neural nets)
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/
April 12, 2023 52
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?
April 12, 2023 53
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?
April 12, 2023 54
Web Privacy
April 12, 2023 55
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?
Voluntary compliance and market forces? Government regulation?
April 12, 2023 56
Homework Assignment1. 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?
April 12, 2023 57
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
April 12, 2023 58
How Do We Control It? The US has tended toward technical, marketplace and voluntary
standards. 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
The European Union has passed the EU Data Privacy Directive. 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/
April 12, 2023 59
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
April 12, 2023 60
Safe Harbor Provisions Notice Choice Onward Transfer (Transfers to Third
Parties) Access Security Data integrity Enforcement
April 12, 2023 61
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.
April 12, 2023 62
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.
April 12, 2023 63
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.
April 12, 2023 64
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.
April 12, 2023 65
Security
Security: Organizations must take reasonable precautions to protect personal information from loss, misuse and unauthorized access, disclosure, alteration and destruction.
April 12, 2023 66
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.
April 12, 2023 67
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.
April 12, 2023 68
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?