Unit 1
Unit 1
VISUALIZATION
Data Mining 1
Introduction to Data Mining
Data Mining 2
Why do we need Data Mining?
• Explosive Growth of Data
– Amount of data collected increasing exponentially
– Automated data collection tools, database systems, Web, computerized society
– Business: Web, e-commerce, transactions, stocks, purchases at grocery stores,
Bank/Credit Card transactions
– Science: remote sensors on a satellite, telescopes scanning skies, microarrays generating
gene expression data,
– Society and everyone: news, digital cameras, YouTube. Facebook, web
• We have mass amount of data, but we need knowledge.
• There is often information (knowledge) “hidden” in the data that is
not readily evident
• Human analysts may take weeks to discover useful information,
• Much of the data is never analyzed
Data Mining 3
Why do we need Data Mining?
• Huge volumes of data are accumulated in databases
and data warehouses.
• Huge volumes of data also come from WWW and
data streams
– (video surveillance, telecommunication, and sensor
networks)
Data Mining 4
What is Data Mining?
• Many Definitions for Data Mining:
– Non-trivial extraction of implicit, previously unknown and potentially useful
information from data
– Exploration & analysis, by automatic or semi-automatic means, of large
quantities of data in order to discover meaningful patterns
– Extracting or “mining” knowledge from large amounts of data.
Data Mining 5
What is (not) Data Mining?
• Is everything “data mining”?
• What is not Data Mining?
– Simple search and query processing
– (Deductive) expert systems
– Look up phone number in phone directory
– Query a Web search engine for information about “Amazon
• What is Data Mining?
– Certain names are more prevalent in certain US locations (O’Brien, O’Rurke,
O’Reilly… in Boston area)
– Which items are bought together in a market?
Data Mining 6
What is Data Mining: Tasks 1
Discuss whether or not each of the following activities is a data mining task?
Data Mining 7
What is Data Mining?: Tasks 1
Discuss whether or not each of the following activities is a data mining task?
Data Mining 8
Origins of Data Mining
• Draws ideas from machine learning/AI, pattern recognition, statistics, and database
systems, …
Applications Visualization
Data Mining
Data Mining 13
Knowledge Discovery (KDD) Process
• A view from typical database systems and
data warehousing communities Pattern
• Data mining plays an essential role in the Evaluation
knowledge discovery process
Data Mining
Task-relevant Data
Selection
Data
Warehouse
Data Cleaning
Data Integration
Databases
Data Mining 14
Data Mining in Business Intelligence
Data Mining 15
KDD Process:
A Typical View from ML and Statistics
Data Mining 16
Data Mining: On What Kinds of Data?
• Database-oriented data sets and applications
– Relational database, data warehouse, transactional database
– Object-relational databases, Heterogeneous databases
• Advanced data sets and advanced applications
– Data streams and sensor data
– Time-series data, temporal data, sequence data (incl. bio-sequences)
– Structure data, graphs, social networks and information networks
– Spatial data and spatiotemporal data
– Multimedia database
– Text databases
– The World-Wide Web
Data Mining 17
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.
Data Mining 18
Classification
• Given a collection of records ( training set )
– Each record contains a set of attributes,
– One of the attributes is the class.
• Find a model for class attribute as a function of the values of other attributes.
Data Mining 19
Classification: Typical Methods & Applications
• Typical methods:
– Decision trees,
– Naïve Bayesian classification,
– support vector machines,
– neural networks,
– rule-based classification,
– pattern-based classification, …
• Typical applications:
– Credit card fraud detection, direct marketing,
– Classifying diseases, web-pages,
Data Mining 20
Classification: Typical Methods
Data Mining 21
Classification: Example
Set
Set Classifier
Data Mining 22
Classification: Application 1
Direct Marketing
Goal:
– Reduce the 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.
Data Mining 23
Classification: Application 2
Fraud Detection
Goal:
– Predict fraudulent cases in credit card 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.
– Learn a model for the class of the transactions.
– Use this model to detect fraud by observing credit card transactions on an
account.
Data Mining 24
Classification – Example
Text Categorization
• How can we classify a given newspaper text as an economy, sport or health article?
Data Mining 25
Classification – Example
Text Categorization
• How can we classify a given newspaper text as an economy, sport or health article?
Data Mining 26
Classification – Example
Text Categorization
• How can we classify a given newspaper text as an economy, sport or health article?
Data Mining 27
Classification – Example
Text Categorization
• How can we classify a given newspaper text as an economy, sport or health article?
Data Mining 28
Classification – Example
Text Categorization
• How can we classify a given newspaper text as an economy, sport or health article?
Data Mining 29
Clustering
• 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 each 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 Similarity Measures: Problem-specific measures.
• Unsupervised learning (i.e., Class label is unknown)
• Group data to form new categories (i.e., clusters),
• Principle: Maximizing intra-class similarity & minimizing interclass similarity
• Many methods and applications
Data Mining 30
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.
Data Mining 32
Association Rule Discovery
• 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.
Support decides how to provide a rule that is accessible to a given data set, while confidence decides how frequently items in Y occurs in transactions
that include X. Confidence measures the accuracy of the inference produced by a rule
Data Mining 33
Association Rule Discovery: Application 1
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 six-packs stacked next to diapers!
Data Mining 34
Association Rule Discovery: Application 2
Inventory Management
Goal:
– A consumer appliance repair company wants to anticipate the nature of repairs on
its consumer products and keep the service vehicles equipped with right parts to
reduce on number of visits to consumer households.
Approach:
– Process the data on tools and parts required in previous repairs at different
consumer locations and discover the co-occurrence patterns.
Data Mining 35
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.
Data Mining 38
Deviation/Anomaly Detection
• Detect significant deviations from normal behavior
• Applications:
– Credit Card Fraud Detection
– Network Intrusion Detection
• Outlier analysis
– Outlier: A data object that does not comply with the general behavior of the data
– Noise or exception?
• One person’s garbage could be another person’s treasure
– Methods: by product of clustering or regression analysis, …
– Useful in fraud detection, rare events analysis
Data Mining 39
Structure and Network Analysis
• Graph mining
– Finding frequent subgraphs (e.g., chemical compounds), trees (XML),
substructures (web fragments)
Data Mining 40
Evaluation of Knowledge
• Are all mined knowledge interesting?
– One can mine tremendous amount of “patterns”
– Some may fit only certain dimension space (time, location, …)
– Some may not be representative, may be transient, …
Data Mining 41
Classification
Learn a method for predicting the instance class from pre-labeled
(classified) instances
45
Clustering
46
Association Rules & Frequent Itemsets
Transactions
Frequent Itemsets:
TID Produce
1 MILK, BREAD, EGGS Milk, Bread (4)
2 BREAD, SUGAR Bread, Cereal (3)
3 BREAD, CEREAL Milk, Bread, Cereal (2)
4 MILK, BREAD, SUGAR …
5 MILK, CEREAL
6 BREAD, CEREAL
7 MILK, CEREAL
8 MILK, BREAD, CEREAL, EGGS
9 MILK, BREAD, CEREAL
Rules:
Milk => Bread (66%)
47
Visualization & Data Mining
Visualizing the data to
facilitate human
discovery
Presenting the
discovered results in a
visually "nice" way
48
Summarization
49
Data Mining Models and Tasks
• User Interaction
– Interactive mining
– Incorporation of background knowledge
– Presentation and visualization of data mining results
Data Mining 42
Major Issues in Data Mining
• Efficiency and Scalability
– Efficiency and scalability of data mining algorithms
– Parallel, distributed, stream, and incremental mining methods
Data Mining 43
Summary – Data Mining Overview
• Data mining: Discovering interesting patterns and knowledge from massive amount of
data
• A natural evolution of science and information 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 data
• Data mining functionalities: characterization, discrimination, association,
classification, clustering, trend and outlier analysis, etc.
• Data mining technologies and applications
• Major issues in data mining
Data Mining 44
Software
• The software required for this course (Weka and R/RStudio) are open source and
freely available under GNU General Public License.
• Depending on your system, you can download and install Weka 3.8 which is the
lasted stable version of Weka available at
http://www.cs.waikato.ac.nz/ml/weka/downloading.html.
• In addition, most recent version of R and RStudio (IDE for R) are available at
https://cran.rstudio.com/ and https://www.rstudio.com/products/rstudio/download/,
respectively.
Data Mining 45
Weka
A simple training set (.csv file)
holding our data. Outlook Temp Humidity Wind PlayTennis
Data Mining 46
Weka
Data Mining 47
Weka
Data Mining 48
Reference Books
• Introduction to Data Mining, PangNing Tan, Michael Steinbach, Vipin Kumar, 3rd
Edition, Pearson, 2014.
• Data Mining: Concepts and Techniques, Jiawei Han and Micheline Kamber, Morgan
Kaufmann, 2012.
• Data Mining: Practical Machine Learning Tools and Techniques, Ian H. Witten, Eibe
Frank and Mark A. Hall, 4th Edition, Morgan Kaufmann, 2017.
• Mining of Massive Datasets, Anand Rajaraman & Jeffrey D. Ullman, 2011
• T. Hastie, R. Tibshirani, and J. Friedman, The Elements of Statistical Learning: Data
Mining, Inference, and Prediction, Springer, 2009
• B. Liu, Web Data Mining, Springer 2006
Data Mining 49