Data Mining: Techniques and Applications
Data Mining: Techniques and Applications
4
Knowledge discovery process or Data Mining Process
Typical framework of a DW
Data source
in Chicago
Client
Data source Clean
in New York Integrate Query &
Transform Data
Warehouse
analysis
Data source Load
in Toronto Refresh tools
Client
Data source
in
Vancouver
DW
• Historical information.
• Usually modelled by a Multidimensional database structure.
• A multidimensional model views data in the form of a data-cube.
• A data cube enables data to be modeled and viewed in multiple dimensions in which
each dimension corresponds to an attribute or a set of attributes in the schema, and
each cell stores the value of some aggregate measure such as count or sum.
• For example, a shop may create a sales data warehouse to keep records of the
store's sales for the dimension time, item, and location. These dimensions allow the
save to keep track of things, for example, monthly sales of items and the locations at
which the items were sold. Each dimension has a table related to it, called a
dimensional table, which describes the dimension further.
For example, a dimensional table for an item may contain the attributes item name,
brand, and type.
Multidimensional Data Cube: OLAP operations
• DW systems are well suited for on-line analytical processing (OLAP)
• OLAP is an acronym for Online Analytical Processing. OLAP performs multidimensional
analysis of business data and provides the capability for complex calculations, trend
analysis, and sophisticated data modeling.
• OLAP operations allow the user to view the data at differing degrees of
summarization
a) Concept/Class Description
b) Mining of Frequent Patterns
c) Mining of Associations
d) Mining of Correlations
e) Mining of Clusters
a) Concept/Class Description: Characterization and Discrimination
▪ The system should allow users to drill down on any dimension, such as on
occupation in order to view these customers according to their type of
employment
• Example: User- compare the general features of software products whose sales increased by
10% in the last year with those whose sales decreased by at least 30% during the same period.
• Compare two groups of AllElectronics customers :
1) Those who shop for computer products regularly (more than 2 times a month)
2) those who rarely shop for such products (i.e., less than 3 times a year).
• Result –
a) 80% of the customers - frequently purchase computer products are between 20 and 40
years old and have a university education
b) 60% of the customers - infrequently buy such products are either seniors or youths, and
have no university degree.
Drilling down on a dimension, such as occupation, or adding new dimensions, such as income
level, may help in finding even more discriminative features between the two classes.
• The methods and output used for data discrimination are similar to those used for data
characterization.
Frequent patterns are those patterns that occur frequently in data.
Kinds of frequent patterns:
❖Frequent Itemsets - It refers to a set of items that frequently appear
together in a transactional data set.
Eg: milk and bread , bread and jam, cell phone and charger,
❖Frequent Subsequence- A sequence of patterns that occur frequently
such as purchasing laptop, followed by a camera, then a memory card.
❖Frequent Sub Structure - Substructure refers to different structural
forms, such as graphs, trees, or lattices, which may be combined with
item-sets or subsequences . If a substructure occurs frequently in a
graph database, it is called a (frequent) structural pattern.
• Discovery of togetherness or connection of items – Association rule
• This process involves uncovering the relationship between data and
deciding the rules of the association.
• Associations are used in retail sales to identify patterns that are frequently
purchased together.
• For example, a retailer generates an association rule that shows that 70%
of time milk is sold with bread and only 30% of times biscuits are sold with
bread.
• Eg:80% of people buy soft drinks together with potato chips
Example
Association analysis: Suppose a marketing manager of AllElectronics, would like to
determine which items are frequently purchased together within the same
transactions.????
• 1% support means → that 1% of all of the transactions under analysis showed that computer and
software were purchased together.
Total 1% of transactions in database follow the rule.
• This association rule involves a single attribute or predicate (i.e., buys) that
repeats. Such Asociation rules having a single predicate are referred to as single-
dimensional association rules.
• buys(X, “computer”)=>buys(X, “software”)=>[support = 1%, confidence = 50%]
Regression analysis
• Regression analysis is a statistical methodology that is most often
used for numeric prediction.
• Primarily it gives the exact relationship between two or more
variables in the given data set.
• For example, we might use it to project certain costs, depending on
other factors such as availability, consumer demand, and competition.
Outliers are data objects that do not comply with
the general behaviour or model of the data available.
• Outliers are data elements that cannot be grouped in a given class or
cluster
• Sometimes outliers can be considered noise and discarded in some
applications. An outlier can cause serious problems in statistical
analyses.
1. Supervised learning .
It is based on the classification. In this method, the desired
outputs are included in the training dataset.
2. Unsupervised learning
Unsupervised learning is based on clustering. Clusters are
formed on the basis of similarity measures and desired outputs
are not included in the training dataset.
3. Semi-supervised learning
Semi-supervised learning includes some desired outputs to the
training dataset to generate the appropriate functions. This method
generally avoids the large number of labeled examples (i.e. desired outputs).
4. Active learning :
Active learning is a powerful approach in analyzing the data efficiently.
Active learning is the subset of machine learning in which a learning algorithm can query a user
interactively to label data with the desired outputs.
ie, selects the subset of examples to be labeled next from the pool of unlabeled data
3. Information retrieval
• Science of searching for documents or information in documents.
• Retrieving Information from text or images with the help of the semantics
of objects (text, images).
For example: Finding relevant information from a large document.
4. Database systems and data warehouse
• Databases are used for the purpose of recording the data.
• Online Transactional Processing (OLTP) uses databases for day to day
transaction
purpose.
• Data warehouses are used to store historical data which helps to take
strategical decision for business.
• It is used for online analytical processing (OALP), which helps to analyze
the data.
Applications of Data mining
DM Applications
• Data mining is used in diverse applications such as banking, marketing,
healthcare, telecom industries, and many other areas.
• Data mining techniques help companies to gain knowledgeable
information, increase their profitability by making adjustments in processes
and operations. It is a fast process which helps business in decision making
through analysis of hidden patterns and trends.
• AMAZON: Amazon uses Text Mining to find the lowest price of the product.
• MC Donald’s: McDonald’s uses big data mining to enhance its customer
experience. It studies the ordering pattern of customers, waiting times, size
of orders, etc.
• NETFLIX: Netflix finds out how to make a movie or a series popular among
the customers using its data mining insights.
1. Financial Analysis
• The banking and finance industry relies on high-quality, reliable data. In loan markets,
financial and user data can be used for a variety of purposes, like predicting loan
payments and determining credit ratings. Banks are the first users of data mining
technology as it helps them with credit assessment. Data mining analyzes what
services offered by banks are used by customers, what type of customers use
ATM cards and what do they generally buy using their cards (for cross-selling).
• Banks use data mining to analyze the transactions which the customer do
before they decide to change the bank to reduce customer attrition. Also, some
outliers in transactions are analyzed for fraud detection.
2. Telecommunication Industry
• Expanding and growing at a fast pace, especially with the advent of the internet. Data
mining can enable key industry players to improve their service quality to stay ahead in
the game.
• Cellular Phone Companies use data mining techniques to avoid churning.
Churning is a measure showing the number of customers leaving the services.
It detects patterns that show how customers can benefit from the services to
retain customers.
3. Intrusion Detection
• Global connectivity in today’s technology-driven economy has presented security
challenges for network administration. Network resources can face threats and actions
that intrude on their confidentiality or integrity. Therefore, detection of intrusion has
emerged as a crucial data mining practice. Association and correlation analysis,
aggregation techniques, visualization, and query tools can effectively detect any
anomalies or deviations from normal behavior.
4. Retail Industry
• The organized retail sector holds sizable quantities of data points covering sales,
purchasing history, delivery of goods, consumption, and customer service. The databases
have become even larger with the arrival of e-commerce marketplaces.
• In modern-day retail, data warehouses are being designed and constructed to get the full
benefits of data mining. Multidimensional data analysis helps deal with data related to
different types of customers, products, regions, and time zones. Online retailers can also
recommend products to drive more sales revenue and analyze the effectiveness of their
promotional campaigns. So, from noticing buying patterns to improving customer service
and satisfaction, data mining opens many doors in this sector.
5. Spatial Data Mining
• Geographic Information Systems (GIS) and several other navigation applications
make use of data mining to secure vital information and understand its
implications. This new trend includes extraction of geographical, environment,
and astronomical data, including images from outer space. Typically, spatial data
mining can reveal aspects like topology and distance.
6. Biological Data Analysis
• Biological data mining practices are common in genomics, proteomics, and
biomedical research. From characterizing patients’ behaviour and predicting
office visits to identifying medical therapies for their illnesses, data science
techniques provide multiple advantages.
7. Criminal Investigation
• Data mining activities are also used in Criminology, which is a study of crime
characteristics. First, text-based crime reports need to be converted into word
processing files. Then, the identification and crime-machining process would
take place by discovering patterns in massive stores of data
8. Healthcare Management
• The data mining method is used to identify chronic diseases,
track high-risk regions prone to the spread of disease, design
programs to reduce the spread of disease. Healthcare
professionals will analyze the diseases, regions of patients
with maximum admissions to the hospital.
• With this data, they will design the campaigns for the region
to make people aware of the disease and see how to avoid
it. This will reduce the number of patients admitted to
hospitals.
9. Customer Relationship Management can be reinforced with
data mining. Good customer Relations can be built by
attracting more suitable customers, better cross-selling and
up-selling, better retention.
Major Issues in Data mining
• Major data mining issues can be partitioned into five groups:
1. Mining methodology.
2. User Interaction.
3. Efficiency and scalability.
4. Diversity of data types.
5. Data mining and society.
1. Mining methodology
- Mining various and new kinds of knowledge
- Mining knowledge in multidimensional space.
- Data mining-an interdisciplinary effort.
- Boosting the power of discovery in a networked environment.
- Handling uncertainty, noise or incompleteness of data
- Pattern evaluation and pattern- or constraint-guided mining.
2. User Interaction
- Interactive mining
- Incorporation of background knowledge
- Ad hoc data mining and data mining query languages
- Presentation and visualization of data mining results
3. Efficiency and Scalability
- Efficiency and scalability of data mining algorithms
- Parallel, distributed, and incremental mining algorithms
6
Discrete vs. Continuous Attributes
• Discrete Attribute
• Has only a finite or countably infinite set of values
• E.g., zip codes, profession, or the set of words in a collection of
documents
• Sometimes, represented as integer variables
• Note: Binary attributes are a special case of discrete
attributes
• Continuous Attribute
• Has real numbers as attribute values
• E.g., temperature, height, or weight
• Continuous attributes are typically represented as floating-
point variables
8
Basic Statistical Descriptions of Data
Measures of
1. Central Tendency
2. Distribution
3. Dispersion
4. Association
Basic Statistical Descriptions of Data
• For data preprocessing to be successful, it is essential to have an overall
picture of your data.
• Basic statistical descriptions can be used to identify properties of the data
and highlight which data values should be treated as noise or outliers.
• To better understand the data: central tendency, variation and spread
Describe data using measures of central tendency and dispersion:
• for a set of individual data values, and
• for a set of grouped data.
• Use the computer to visually represent data.
• The basic statistical descriptions of data help us to measure some
very special properties of the data.
• One of these properties is the central tendency. Measuring the
central tendency helps us know, where does most of the data lie
taking into account the whole set of data.
• Let us take a use case. Suppose that we have a set of values and we
want to find a value that has the capability of replacing the whole
dataset and still achieve a relevant result.
• Finding the central tendency helps us achieve this use case.
Descriptive Statistics: Shape – Center - Spread
When we gather data, we want to uncover the “information” in it. One easy way
to do that is to think of: “Shape –Center- Spread”
The median is particularly useful if there are outliers in the data set.
Mode
This is another measure of central tendency.
The mode is the most frequent value.
Bimodal, Trimodal, Multimodal datasets
• There is an equal possibility that a dataset might have two modes. Such
datasets are known as Bimodal.
• Trimodal- Data set with three modes. Ie, there are three data values that
are having highest frequencies.
• Ex: A={2,2,2,3,4,4,5,6,5,4,7,5,8} is 2,4 and 5
• In general, a dataset with two or more modes is known as Multimodal.
• While there is just one value for the mean and one value for the median,
there may be more than one value for the mode of a data set.
Bimodal dataset
In an asymmetrical distribution the two sides will not be mirror images of each other.
Skewness is the tendency for the values to be more frequent around the high or low
ends of the x-axis.
• If mode < median < mean, the shape of the distribution trails to the right, is
positively skewed (Right skewed).
• If mean < median < mode, the shape of the distribution trails to the left, is
negatively skewed(Left skewed).
Distributions of various “shapes” have different properties and names such as the
“normal” distribution, which is also known as the “bell curve” (among
mathematicians it is called the Gaussian Distribution).
Symmetric Asymmetric Right skewed
Final Conclusion : In general the boys are taller than the girls.
: 25% of the boys are taller than the tallest girl.
Interquartile Range - IQR
• Interquartile Range (IQR): The distance between the first and third
quartiles is a simple measure of the spread that gives the range
covered by the middle half of the data.
IQR = Q3 - Q1
Quantiles
The 2-quantile is the data point dividing the lower and upper halves of the data
distribution. It corresponds to the median of the set of values.
The 4-quantiles are the three data points that split the data distribution into four
equal parts, where each part represents one-fourth of the data distribution.
Also commonly called as quartiles.
Variance & Standard Deviation
These are the measures of data dispersion. We can measure how spread
out a data distribution is.
• A low standard deviation means that the data observations tend to be
very close to the mean.
• A high standard deviation means that the data are spread out over a large
range of values.
• Mathematically, the standard deviation is defined as the square root of
the variance.
• The variance of N observations, x1, x2, x3….xn, for a numeric attribute X is
Data Visualization
Data Visualization
(a) Income (b) Credit Limit (c) transaction volume (d) age
42
Geometric Projection Visualization Techniques
• Visualization of geometric transformations and projections of the
data
• Methods
• Scatterplot
43
Geometric Projection Visualization Techniques
45
Icon-Based Visualization Techniques
• Visualization of the data values as features of icons
• Typical visualization methods
• Chernoff Faces
• Stick Figures
• General techniques
• Shape coding: Use shape to represent certain information
encoding
• Color icons: Use color icons to encode more information
• Tile bars: Use small icons to represent the relevant feature
vectors in document retrieval
46
Chernoff Faces
• They display multidimensional data of up to 18 variables (or dimensions) as a
cartoon human face.
• Chernoff faces help reveal trends in the data.
• Components of the face, such as the eyes, ears, mouth, and nose, represent
values of the dimensions by their shape, size, placement, and orientation.
• For example, dimensions can be mapped to the following facial
characteristics: eye size, eye spacing, nose length, nose width, mouth
curvature, mouth width, mouth openness, pupil size, eyebrow slant, eye
eccentricity, and head eccentricity.
A census data
figure showing
age, income,
gender,
education, etc.
48
Two attributes mapped to axes, remaining attributes mapped to angle or length of limbs”. Look at texture pattern
Hierarchical Visualization Techniques
• They partition all dimensions into subsets (i.e.,
subspaces). The subspaces are visualized in a hierarchical
manner.
• Methods
• Worlds-within-Worlds
• Tree-Map
49
Worlds-within-Worlds
• “Worlds-within-Worlds,” also known as n-Vision, is a representative hierarchical
visualization method.
• Suppose we want to visualize a 6-D data set, where the dimensions are F,X1, : : : ,X5.
• We want to observe how dimension F changes with respect to the other dimensions.
We can first fix the values of dimensions X3,X4,X5 to some selected values,say, c3, c4,
c5.
• We can then visualize F,X1,X2 using a 3-D plot, called a world.
• A user can interactively change, in the outer world, the location of the origin of the
inner world. The user then views the resulting changes of the inner world. Moreover,
a user can vary the dimensions used in the inner world and the outer world. Given
more dimensions, more levels of worlds can be used, which is why the method is
called “worlds-within worlds.
50
Tree-Map
• Tree-maps display hierarchical data as a set of nested rectangles
• Screen-filling method which uses a hierarchical partitioning of the
screen into regions depending on the attribute values
51
Newsmap: Google News Stories in 2005
Measuring Data Similarity and Dissimilarity
53
Data Matrix and Dissimilarity Matrix
• Data matrix(object-by-attribute structure)
• used to store the data objects x11 ... x1f ... x1p
having multiple attributes.
• n data objects with p ... ... ... ... ...
x ... xif ... xip
attributes. i1
... ... ... ... ...
x ... xnf ... xnp
• Dissimilarity matrix(object-by-object n1
structure)
• used to store dissimilarity 0
values for pairs of objects d(2,1)
0
• n data objects, but registers
only the distance d(3,1) d ( 3,2) 0
• A triangular matrix : : :
• Single mode d ( n,1) d ( n,2) ... ... 0
54
Proximity Measure for Nominal Attributes
• Nominal attribute can take on two or more states ( e.g., red,
yellow, blue, green)
• The dissimilarity between two objects i and j can be computed
based on the ratio of mismatches:
d (i, j) = p −
p
m
55
Proximity Measure for Binary Attributes
• Binary attribute has only one of two states: 0 and 1, where 0
means that the attribute is absent, and 1 means that it is present
56
Dissimilarity of Numeric Data: Minkowski Distance
• First the data are normalized before applying distance calculations. This involves
transforming the data to fall within a smaller or common range, such as [-1, 1] or
[0.0, 1.0]. Normalizing the data attempts to give all attributes an equal weight.
Distance on Numeric Data: Minkowski Distance
• Minkowski distance: is a generalization of the Euclidean and Manhattan
distances
where i = (xi1, xi2, …, xip) and j = (xj1, xj2, …, xjp) are two p-
dimensional data objects, and h is the order (the distance so
defined is also called L-h norm)
• Properties
• d(i, j) > 0 if i ≠ j, and d(i, i) = 0 (Positive definiteness)
• d(i, j) = d(j, i) (Symmetry)
• d(i, j) d(i, k) + d(k, j) (Triangle Inequality)
• A distance that satisfies these properties is a metric
58
Cosine Similarity
• A document can be represented by thousands of attributes, each recording the
frequency of a particular word (such as keywords) or phrase in the document.
59
Summary
• Data attribute types: nominal, binary, ordinal, interval-scaled, ratio-scaled
• Many types of data sets, e.g., numerical, text, graph, Web, image.
• Gain insight into the data by:
• Basic statistical data description: central tendency, dispersion, graphical
displays
• Data visualization: map data onto graphical primitives
• Measure data similarity
• Above steps are the beginning of data preprocessing.
• Many methods have been developed but still an active area of research.
60
Chapter 3: Data Preprocessing
◼ Data Quality
◼ Data Cleaning
◼ Data Integration
◼ Data Reduction
◼ Summary
1
Major Tasks in Data Preprocessing
◼ Data cleaning
◼ Fill in missing values, smooth noisy data, identify or remove
outliers, and resolve inconsistencies
◼ Data integration
◼ Integration of multiple databases, data cubes, or files
◼ Data reduction
◼ Dimensionality reduction
◼ Numerosity reduction
◼ Data transformation and data discretization
◼ Normalization
◼ Concept hierarchy generation
2
3
Chapter 3: Data Preprocessing
◼ Data Quality
◼ Data Cleaning
◼ Data Integration
◼ Data Reduction
◼ Summary
4
Data Cleaning
◼ Data in the Real World Is Dirty: Lots of potentially incorrect data,
e.g., instrument faulty, human or computer error, transmission error
◼ incomplete: lacking attribute values, lacking certain attributes of
interest, or containing only aggregate data
◼ e.g., Occupation=“ ” (missing data)
◼ noisy: containing noise, errors, or outliers
◼ e.g., Salary=“−10” (an error)
◼ inconsistent: containing discrepancies in codes or names, e.g.,
◼ Birthday=“03/07/2010”, Age=“42”
◼ Was rating “1, 2, 3”, now rating “A, B, C”
◼ discrepancy between duplicate records
◼ Intentional (e.g., disguised missing data)
◼ Jan. 1 as everyone’s birthday?
5
Incomplete (Missing) Data
6
How to Handle Missing Data?
◼ Ignore the tuple: usually done when class label is missing
(when doing classification)—not effective when the % of
missing values per attribute varies considerably
◼ Fill in the missing value manually: tedious + infeasible?
◼ Fill in it automatically with
◼ a global constant : e.g., “unknown”, a new class?!
◼ Use a measure of central tendency : the attribute mean
◼ Use the attribute mean for all samples belonging to
the same class: smarter way
◼ the most probable value: inference-based such as
Bayesian formula or decision tree
7
Noisy Data
◼ Noise: random error or variance in a measured variable
◼ Incorrect attribute values may be due to
◼ faulty data collection instruments
◼ technology limitation
◼ incomplete data
◼ inconsistent data
8
How to Handle Noisy Data?
◼ Binning
◼ first sort data and partition into (equal-frequency) bins
◼ Regression
◼ smooth by fitting the data into regression functions.
Linear regression involves finding the “best” line to fit two attributes (or
variables) so that one attribute can be used to predict the other. Multiple linear
regression- more than two attributes are involved and the data are fit to a
multidimensional surface.
◼ Clustering -Outlier analysis
◼ detect and remove outliers.
10
Data Cleaning as a Process
◼ Data discrepancy detection
◼ Use metadata
◼ Data Quality
◼ Data Cleaning
◼ Data Integration
◼ Data Reduction
◼ Summary
12
Data Integration
◼ Data integration:
◼ Combines data from multiple sources into a coherent store. The sources
may include multiple databases, data cubes, or flat files
◼ Schema integration: e.g., [Link]-id [Link]-#
◼ Integrate metadata from different sources
◼ Entity identification problem:
◼ Identify real world entities from multiple data sources, e.g., Bill Clinton
= William Clinton
◼ Detecting and resolving data value conflicts
◼ For the same real world entity, attribute values from different sources
are different
◼ Possible reasons: different representations, different scales, e.g., metric
vs. British units 13
Handling Redundancy in Data Integration
◼ The larger the Χ2 value, the more likely the variables are
related
15
◼ The cells that contribute the most to the Χ2 value are
those whose actual count is very different from the
expected count
Scatter plots
showing the
similarity from
–1 to 1.
18
Covariance (Numeric Data)
◼ Covariance is similar to correlation
Correlation coefficient:
19
Tuple Duplication
◼ In addition to detecting redundancies between attributes,
duplication should also be detected at the tuple level.
[denormalized tables, duplicates]
20
21
◼ Data Quality
◼ Data Cleaning
◼ Data Integration
◼ Data Reduction
◼ Summary
21
Data Reduction Strategies
◼ Data reduction: Obtain a reduced representation of the data set that is
much smaller in volume but yet produces the same (or almost the same)
analytical results
◼ Why data reduction? — A database/data warehouse may store terabytes
of data. Complex data analysis may take a very long time to run on the
complete data set.
◼ Data reduction strategies
◼ Dimensionality reduction, e.g., remove unimportant attributes
◼ Wavelet transforms
◼ Data compression
22
23
Wavelet Transformation
◼ Wavelet transforms can be applied to multidimensional
data such as data cubes.
◼ Wavelet transforms have many real world applications,
including the compression of fingerprint images,
computer vision, and analysis of time-series data and
data cleaning.
Principal Component Analysis (PCA)
◼ Principal components analysis (PCA; also called
the K-L, method searches for k n-dimensional Principal
orthogonal vectors that can best be used to components
represent the data, where k <=n. analysis. Y and
1
◼ The original data are thus projected onto a much two principal
smaller space, resulting in dimensionality components for
the
reduction. given data.
◼ PCA “combines” the essence of attributes by
creating an alternative, smaller set of variables.
◼ The initial data can then be projected onto this
smaller set. PCA often reveals relationships that
were not previously suspected and thereby
allows interpretations that would not ordinarily
result.
26
Principal Component Analysis (Steps)
◼ Given N data vectors from n-dimensions, find k ≤ n orthogonal vectors
(principal components) that can be best used to represent data
◼ Normalize input data: Each attribute falls within the same range
◼ Compute k orthonormal (unit) vectors, i.e., principal components
◼ Each input data (vector) is a linear combination of the k principal
component vectors
◼ The principal components are sorted in order of decreasing
“significance” or strength
◼ Since the components are sorted, the size of the data can be
reduced by eliminating the weak components, i.e., those with low
variance (i.e., using the strongest principal components, it is
possible to reconstruct a good approximation of the original data)
◼ Works for numeric data only
27
Attribute Subset Selection[feature subset selection]
◼ Attribute subset selection reduces the data set size by removing
irrelevant or redundant attributes (or dimensions).
◼ The goal of attribute subset selection is to find a minimum set of
attributes such that the resulting probability distribution of the data
classes is as close as possible to the original distribution obtained using
all attributes.
◼ Redundant attributes
◼ Duplicate much or all of the information contained in one or more
other attributes
◼ Irrelevant attributes
◼ Contain no information that is useful for the data mining task at
hand
◼ E.g., students' ID is often irrelevant to the task of predicting
students' GPA
28
Attribute Selection methods
1. Stepwise forward selection: The procedure starts with an empty set of attributes
as the reduced set. The best of the original attributes is determined and added to
the reduced set. At each subsequent iteration or step, the best of the remaining
original attributes is added to the set.
2. Stepwise backward elimination: The procedure starts with the full set of
attributes. At each step, it removes the worst attribute remaining in the set.
3. Combination of forward selection and backward elimination: The stepwise
forward selection and backward elimination methods can be combined so that, at
each step, the procedure selects the best attribute and removes the worst from
among the remaining attributes.
4. Decision tree induction: Decision tree induction constructs a flowchart like
structure where each internal (nonleaf) node denotes a test on an attribute, each
branch corresponds to an outcome of the test, and each external (leaf) node denotes
a class prediction. At each node, the algorithm chooses the “best” attribute to
partition the data into individual classes.
29
30
Attribute Creation (Feature construction)
◼ Create new attributes (features) that can capture the
important information in a data set more effectively than
the original ones
◼ Such attribute construction can help improve
accuracy and understanding of structure in high
dimensional data.
◼ For example, we may wish to add the attribute area
based on the attributes height and width.
31
Data Reduction 2: Numerosity Reduction
◼ Reduce data volume by choosing alternative, smaller
forms of data representation
◼ Parametric methods (e.g., regression)
◼ Assume the data fits some model, estimate model
32
y
Regression Analysis Y1
◼ Regression analysis: A collective name for
techniques for the modeling and analysis of
Y1’
numerical data consisting of values of a y=x+1
dependent variable (also called response
variable or measurement) and of one or
more independent variables ( explanatory x
X1
variables or predictors)
◼ For example, a random variable, y (called a
◼ Used for prediction
response variable), can be modeled as a
(including forecasting
linear function of another random variable, of time-series data),
x (called a predictor variable), with the inference, hypothesis
equation y = wx + b, testing, and modeling
◼ The parameters are estimated so as to give of causal relationships
a "best fit" of the data.
33
Regress Analysis and Log-Linear Models
◼ Linear regression: Y = w X + b
◼ Two regression coefficients, slope w and intercept b, specify the line and
are to be estimated by using the data at hand
◼ Using the least squares criterion to the known values of Y1, Y2, …, X1, X2,
….
◼ Multiple regression: Y = b0 + b1 X1 + b2 X2
◼ Many nonlinear functions can be transformed into the above
◼ Log-linear models:
◼ Approximate discrete multidimensional probability distributions
◼ Given a set of tuples in n dimensions (e.g., described by n attributes),
consider each tuple as a point in an n-dimensional space and estimate the
probability of each point in a multi-dimensional space for a set of
discretized attributes, based on a smaller subset of dimensional
combinations . Useful for dimensionality reduction and data smoothing
34
Histogram Analysis
36
Sampling
37
Types of Sampling
◼ Stratified sampling:
◼ Partition the data set, and draw samples from each
partition (proportionally, i.e., approximately the same
percentage of the data)
◼ Used in conjunction with skewed data
38
39
Raw Data
Sampling: Cluster or Stratified Sampling
40
6/6/2024 Data Mining: Concepts and Techniques 41
42
◼ Data Quality
◼ Data Cleaning
◼ Data Integration
◼ Data Reduction
◼ Summary
45
Data Transformation
◼ A function that maps the entire set of values of a given attribute to a new set of
replacement values s.t. each old value can be identified with one of the new values
◼ Methods
◼ Smoothing: Remove noise from data. Techniques include binning, regression,
and clustering
◼ Attribute/feature construction
◼ New attributes constructed from the given ones
◼ Aggregation: Summarization, data cube construction
◼ Normalization: Attribute data are scaled to fall within a smaller, specified range
such as -1.0 to 1.0, or 0.0 to 1.0
◼ Discretization: Concept hierarchy for numeric data, where the raw values of a
numeric attribute (e.g., age) are replaced by interval labels (e.g., 0–10, 11–20,
etc.) or conceptual labels (e.g., youth, adult, senior).
◼ Concept hierarchy generation for nominal data, where attributes such as street
can be generalized to higher-level concepts, like city or country.
Data Transformation -overlap between the
major data preprocessing tasks.
• There is much Smoothing is a form of data cleaning task
• Attribute construction and aggregation are data reduction
techniques.
• Data discretization and concept hierarchy generation are also
forms of data reduction.
• If the discretization process uses class information, then we say
it is supervised discretization. Otherwise, unsupervised.
• If the process starts by first finding one or a few points (called
split points or cut points) to split the entire attribute range, and
then repeats this recursively on the resulting intervals, it is called
top-down discretization or splitting.
• bottom-up discretization or merging, which starts by considering
all of the continuous values as potential split-points, removes
some by merging neighborhood values to form intervals, and
then recursively applies this process to the resulting intervals.
Normalization
Purpose
• The measurement unit used can affect the data analysis.
Expressing an attribute in smaller units will lead to a larger
range for that attribute, and thus tend to give such an
attribute greater effect or “weight.”
• Normalization helps prevent attributes with initially large
ranges (e.g., income) from outweighing attributes with
initially smaller ranges (e.g., binary attributes).
• Normalizing the data give all attributes an equal weight.
• Normalization is particularly useful for classification
algorithms involving neural networks or distance
measurements such as nearest-neighbour classification and
clustering.
Normalization
◼ Min-max normalization: performs a linear transformation on
the original data.
◼ Suppose that minA and maxA are the minimum and maximum
values of an attribute, A.
◼ Min-max normalization maps a value, vi of A to vi’ in the range
[new minA,new maxA] by computing
v − minA
v' = (new _ maxA − new _ minA) + new _ minA
maxA − minA
48
Normalization
◼ In z-score normalization (or zero-mean normalization), the values for an
attribute, A, are normalized based on the mean (i.e., average) and standard
deviation of A. A value, vi , of A is normalized to vi ‘ by computing
v − A
v' =
A
◼ The mean absolute deviation, sA, is more robust to outliers than the standard
deviation. When computing the mean absolute deviation, the deviations from the
mean (i.e., |xi- xj| are not squared; hence, the effect of outliers is somewhat
reduced.
49
Normalization
◼ Normalization by decimal scaling : normalizes by moving the
decimal point of values of attribute A.
◼ The number of decimal points moved depends on the maximum
absolute value of A. A value, vi , of A is normalized to vi’ by
computing
v
v' = j
10
Where j is the smallest integer such that Max(|ν’|) < 1
◼ Suppose that the recorded values of A range from -986 to 917. The
maximum absolute value of A is 986.
◼ To normalize by decimal scaling, we therefore divide each value by
1000 (i.e., j D 3) so that -986 normalizes to -0.986 and 917
normalizes to 0.917
50
Discretization
◼ Three types of attributes
◼ Nominal—values from an unordered set, e.g., color, profession
◼ Ordinal—values from an ordered set, e.g., military or academic
rank
◼ Numeric—real numbers, e.g., integer or real numbers
◼ Discretization: Divide the range of a continuous attribute into
intervals
◼ Interval labels can then be used to replace actual data values
◼ Reduce data size by discretization
◼ Supervised vs. unsupervised
◼ Split (top-down) vs. merge (bottom-up)
51
Data Discretization Methods
◼ Typical methods: All the methods can be applied recursively
◼ Binning
◼ Top-down split, unsupervised
◼ Histogram analysis
◼ Top-down split, unsupervised
◼ Clustering analysis (unsupervised, top-down split or
bottom-up merge)
◼ Decision-tree analysis (supervised, top-down split)
◼ Correlation (e.g., 2) analysis (unsupervised, bottom-up
merge)
52
Simple Discretization: Binning
54
Discretization by Cluster, Decision Tree,
and Correlation Analyses
◼ Clustering, decision tree analysis, and correlation analysis
can be used for data discretization.
◼ Clustering can be used to generate a concept hierarchy
for A by following either a top-down splitting strategy or a
bottom-up merging strategy, where each cluster forms a
node of the concept hierarchy.
◼ In the former, each initial cluster or partition may be
further decomposed into several subclusters, forming a
lower level of the hierarchy.
◼ In the latter, clusters are formed by repeatedly grouping
neighbouring clusters in order to form higher-level
concepts
55
Discretization by Classification &
Correlation Analysis
◼ Classification (e.g., decision tree analysis)
◼ Supervised: Given class labels, e.g. diagnosis class, cancerous vs. benign
◼ select split-points so that a given resulting partition contains as many
tuples of the same class as possible.
◼ Top-down, recursive split
◼ Correlation analysis (e.g., Chi-merge: χ2-based discretization)
◼ Supervised: use class information
◼ Bottom-up merge: find the best neighboring intervals (those having
similar distributions of classes, i.e., low χ2 values) to merge
◼ Merge performed recursively, until a predefined stopping condition
56
Concept Hierarchy Generation
57
Concept Hierarchy Generation
for Nominal Data
◼ Specification of a partial/total ordering of attributes
explicitly at the schema level by users or experts
◼ street < city < state < country
◼ Specification of a hierarchy for a set of values by explicit
data grouping
◼ {Urbana, Champaign, Chicago} < Illinois
◼ Specification of only a partial set of attributes
◼ E.g., only street < city, not others
◼ Automatic generation of hierarchies (or attribute levels) by
the analysis of the number of distinct values
◼ E.g., for a set of attributes: {street, city, state, country}
58
Automatic Concept Hierarchy Generation
◼ Some hierarchies can be automatically generated based on
the analysis of the number of distinct values per attribute in
the data set
◼ The attribute with the most distinct values is placed at
the lowest level of the hierarchy
◼ Exceptions, e.g., weekday, month, quarter, year
◼ Remove redundancies
◼ Detect inconsistencies
◼ Data reduction
◼ Dimensionality reduction
◼ Numerosity reduction
◼ Data compression
60
OLTP vs. OLAP
OLTP OLAP
users clerk, IT professional knowledge worker
function day to day operations decision support
DB design application-oriented subject-oriented
data current, up-to-date historical,
detailed, flat relational summarized, multidimensional
isolated integrated, consolidated
usage repetitive ad-hoc
access read/write lots of scans
index/hash on prim. key
unit of work short, simple transaction complex query
# records accessed tens millions
#users thousands hundreds
DB size 100MB-GB 100GB-TB
metric transaction throughput query throughput, response
61