SlideShare a Scribd company logo
Data Preprocessing
Lecture 3
Data Mining: Concepts and Techniques 1
Data Mining: Concepts and Techniques 2
 Why preprocess the data?
 Data cleaning
 Data integration and transformation
 Data reduction
 Discretization and concept hierarchy generation
Data Mining: Concepts and Techniques 3
Why Data Preprocessing?
 Data in the real world is dirty
 incomplete: lacking attribute values, lacking certain
attributes of interest, or containing only aggregate data

e.g., occupation=“ ”
 noisy: containing errors or outliers

e.g., Salary=“-10”
 inconsistent: containing discrepancies in codes or
names

e.g., Age=“42” Birthday=“03/07/1997”

e.g., Was rating “1,2,3”, now rating “A, B, C”

e.g., discrepancy between duplicate records
Data Mining: Concepts and Techniques 4
Why Is Data Dirty?
 Incomplete data may come from
 “Not applicable” data value when collected
 Different considerations between the time when the data was
collected and when it is analyzed.
 Human/hardware/software problems
 Noisy data (incorrect values) may come from
 Faulty data collection instruments
 Human or computer error at data entry
 Errors in data transmission
 Inconsistent data may come from
 Different data sources
 Functional dependency violation (e.g., modify some linked data)
 Duplicate records also need data cleaning
Data Mining: Concepts and Techniques 5
Why Is Data Preprocessing Important?
 No quality data, no quality mining results!
 Quality decisions must be based on quality data

e.g., duplicate or missing data may cause incorrect or even
misleading statistics.
 Data warehouse needs consistent integration of quality
data
 Data extraction, cleaning, and transformation comprises
the majority of the work of building a data warehouse
Data Mining: Concepts and Techniques 6
Multi-Dimensional Measure of Data Quality
 A well-accepted multidimensional view:
 Accuracy
 Completeness
 Consistency
 Timeliness
 Believability
 Value added
 Interpretability
 Accessibility
 Broad categories:
 Intrinsic, contextual, representational, and accessibility
Data Mining: Concepts and Techniques 7
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 transformation
 Normalization and aggregation
 Data reduction
 Obtains reduced representation in volume but produces the
same or similar analytical results
 Data discretization
 Part of data reduction but with particular importance, especially
for numerical data
Data Mining: Concepts and Techniques 8
Forms of Data Preprocessing
Data Mining: Concepts and Techniques 9
Data Cleaning
 Importance
 “Data cleaning is one of the three biggest problems
in data warehousing”—Ralph Kimball
 “Data cleaning is the number one problem in data
warehousing”—DCI survey
 Data cleaning tasks
 Fill in missing values
 Identify outliers and smooth out noisy data
 Correct inconsistent data
 Resolve redundancy caused by data integration
Data Mining: Concepts and Techniques 10
Missing Data
 Data is not always available
 E.g., many tuples have no recorded value for several
attributes, such as customer income in sales data
 Missing data may be due to
 equipment malfunction
 inconsistent with other recorded data and thus deleted
 data not entered due to misunderstanding
 certain data may not be considered important at the time of
entry
 not register history or changes of the data
 Missing data may need to be inferred.
Data Mining: Concepts and Techniques 11
How to Handle Missing Data?
 Ignore the tuple: usually done when class label is missing (assuming
the tasks in classification—not effective when the percentage 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?!
 the attribute mean
 the attribute mean for all samples belonging to the same class:
smarter
 the most probable value: inference-based such as Bayesian
formula or decision tree
Data Mining: Concepts and Techniques 12
Noisy Data
 Noise: random error or variance in a measured variable
 Incorrect attribute values may due to
 faulty data collection instruments
 data entry problems
 data transmission problems
 technology limitation
 inconsistency in naming convention
 Other data problems which requires data cleaning
 duplicate records
 incomplete data
 inconsistent data
Data Mining: Concepts and Techniques 13
How to Handle Noisy Data?
 Binning
 first sort data and partition into (equal-frequency) bins
 then one can smooth by bin means, smooth by bin
median, smooth by bin boundaries, etc.
 Regression
 smooth by fitting the data into regression functions
 Clustering
 detect and remove outliers
 Combined computer and human inspection
 detect suspicious values and check by human (e.g.,
deal with possible outliers)
Data Mining: Concepts and Techniques 14
Simple Discretization Methods: Binning
 Equal-width (distance) partitioning
 Divides the range into N intervals of equal size: uniform grid
 if A and B are the lowest and highest values of the attribute, the
width of intervals will be: W = (B –A)/N.
 The most straightforward, but outliers may dominate presentation
 Skewed data is not handled well
 Equal-depth (frequency) partitioning
 Divides the range into N intervals, each containing approximately
same number of samples
 Good data scaling
 Managing categorical attributes can be tricky
 Example:
Data Mining: Concepts and Techniques 15
Data Mining: Concepts and Techniques 16
Binning Methods for Data Smoothing
 Sorted data for price (in dollars): 4, 8, 9, 15, 21, 21, 24, 25, 26, 28,
29, 34
* Partition into equal-frequency (equi-depth) bins:
- Bin 1: 4, 8, 9, 15
- Bin 2: 21, 21, 24, 25
- Bin 3: 26, 28, 29, 34
* Smoothing by bin means:
- Bin 1: 9, 9, 9, 9
- Bin 2: 23, 23, 23, 23
- Bin 3: 29, 29, 29, 29
* Smoothing by bin boundaries:
- Bin 1: 4, 4, 4, 15
- Bin 2: 21, 21, 25, 25
- Bin 3: 26, 26, 26, 34
 Suppose the data for analysis includes the
attribute Age. The age values for the data tuples
(instances) are (in increasing order):
13, 15, 16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25,
25,30, 33, 33, 35, 35, 35, 35, 36, 40, 45, 46, 52,
70.
 Use binning (by bin means) to smooth the above
data using a bin data, depth of 3.
Data Mining: Concepts and Techniques 17
Data Mining: Concepts and Techniques 18
Regression
x
y
y = x + 1
X1
Y1
Y1’
Data Mining: Concepts and Techniques 19
Cluster Analysis
Data Mining: Concepts and Techniques 20
Data Integration
 Data integration:
 Combines data from multiple sources into a coherent
store
 Schema integration: e.g., A.cust-id ≡ B.cust-#
 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
Data Mining: Concepts and Techniques 21
Handling Redundancy in Data Integration
 Redundant data occur often when integration of multiple databases
 Object identification: The same attribute or object may have
different names in different databases
 Derivable data: One attribute may be a “derived” attribute in
another table, e.g., annual revenue
 Redundant attributes may be able to be detected by correlation
analysis
 For nominal data, we use the chi-square test. For numeric attributes,
we can use the correlation coefficient and covariance.
 Careful integration of the data from multiple sources may help
reduce/avoid redundancies and inconsistencies and improve mining
speed and quality
Data Mining: Concepts and Techniques 22
Data Transformation
 Smoothing: remove noise from data
 Aggregation: summarization, data cube construction
 Generalization: concept hierarchy climbing
 Normalization: scaled to fall within a small, specified
range
 min-max normalization
 z-score normalization
 normalization by decimal scaling
 Attribute/feature construction
 New attributes constructed from the given ones
Data Mining: Concepts and Techniques 23
Data Transformation: Normalization
 Min-max normalization: to [new_minA, new_maxA]
 Ex. Let income range $12,000 to $98,000 normalized to [0.0,
1.0]. Then $73,000 is mapped to
 Z-score normalization (μ: mean, σ: standard deviation):
 Ex. Let μ = 54,000, σ = 16,000. Then
 Normalization by decimal scaling
716.00)00.1(
000,12000,98
000,12600,73
=+−
−
−
AAA
AA
A
minnewminnewmaxnew
minmax
minv
v _)__(' +−
−
−
=
A
Av
v
σ
µ−
='
j
v
v
10
'= Where j is the smallest integer such that Max(|ν’|) < 1
225.1
000,16
000,54600,73
=
−
Data Mining: Concepts and Techniques 24
Data Reduction Strategies
 Why data reduction?
 A database/data warehouse may store terabytes of data
 Complex data analysis/mining may take a very long time to run
on the complete data set
 Data reduction
 Obtain a reduced representation of the data set that is much
smaller in volume but yet produce the same (or almost the
same) analytical results
Data reduction strategies
 Dimensionality reduction — e.g., remove unimportant attributes
 Wavelet transforms and principal components analysis which transform
or project the original data onto a smaller space. Attribute subset
selection is a method of dimensionality reduction in which irrelevant,
weakly relevant, or redundant attributes or dimensions are detected and
removed .
 Numerosity reduction — e.g., fit data into models
 replace the original data volume by alternative, smaller forms of data
representation. These techniques may be parametric or nonparametric.
For parametric methods, a model is used to estimate the data, so that
typically only the data parameters need to be stored, instead of the actual
data. Regression and log-linear models are examples. Nonparametric
methods for storing reduced representations of the data include
histograms, clustering, sampling, and data cube aggregation
 Data compression
 Dimensionality reduction and numerosity reduction techniques
can also be considered forms of data compression.
Data Mining: Concepts and Techniques 25
Data Mining: Concepts and Techniques 26
Attribute Subset Selection
 Feature selection (i.e., attribute subset selection):
 Select a minimum set of features such that the
probability distribution of different classes given the
values for those features is as close as possible to the
original distribution given the values of all features
 reduce # of patterns in the patterns, easier to understand
 Heuristic methods (due to exponential # of choices):
 Step-wise forward selection
 Step-wise backward elimination
 Combining forward selection and backward elimination
 Decision-tree induction
Data Mining: Concepts and Techniques 27
Heuristic Feature Selection Methods
 There are 2d
possible sub-features of d features
 Several heuristic feature selection methods:
 Best single features under the feature independence
assumption: choose by significance tests
 Best step-wise feature selection:

The best single-feature is picked first

Then next best feature condition to the first, ...
 Step-wise feature elimination:

Repeatedly eliminate the worst feature
 Best combined feature selection and elimination
Data Mining: Concepts and Techniques 28
Example of Decision Tree Induction
Initial attribute set:
{A1, A2, A3, A4, A5, A6}
A4 ?
A1? A6?
Class 1 Class 2 Class 1 Class 2
> Reduced attribute set: {A1, A4, A6}
Numerosity Reduction
 Parametric methods
 Assume the data fits some model, estimate model
parameters, store only the parameters, and discard
the data (except possible outliers)
 Example: Regression, Log-linear models
 Non-parametric methods
 Do not assume models
 Major families: histograms, clustering, sampling
Histograms
 A popular data reduction
technique
 Divide data into buckets
and store average (or
sum) for each bucket
0
5
10
15
20
25
30
35
40
10000 30000 50000 70000 90000
Histogram types
 Equal-width: In an equal-width histogram, the width of each
bucket range is uniform
 Equal-frequency (or equal-depth): In an equal-frequency
histogram, the buckets are created so that, roughly, the frequency of
each bucket is constant (i.e., each bucket contains roughly the
same number of contiguous data samples).
Example:
 not yet in school: 2
 in primary school: 5
 in high school: 9
Clustering
 Partitions data set into clusters, and models it by one
representative from each cluster
 Can be very effective if data is clustered but not if data
is “smeared”
Sampling
 Sampling can be used as a data reduction technique because it
allows a large data set to be represented by a much smaller random
data sample (or subset). Suppose that a large data set, D, contains N
tuples.
 Simple random sample without replacement (SRSWOR) of
size s: This is created by drawing s of the N tuples from D (s < N),
where the probability of drawing any tuple in D is 1=N, that is, all
tuples are equally likely to be sampled.
 Simple random sample with replacement (SRSWR) of size
s: This is similar to SRSWOR, except that each time a tuple is drawn
from D, it is recorded and then replaced. That is, after a tuple is
drawn, it is placed back in D so that it may be drawn again.
Sampling
SRSWOR
(simple random
sample without
replacement)
SRSWR
Raw Data
Sampling
Raw Data Cluster/Stratified Sample
•The number of samples drawn from each
cluster/stratum is analogous to its size
•Thus, the samples represent better the data and
outliers are avoided
Data Mining: Concepts and Techniques 38
Data Cube Aggregation
 Concept hierarchies may exist for each attribute, allowing the analysis
of data at multiple abstraction levels. For example, a hierarchy for
branch could allow branches to be grouped into regions, based on
their address. Data cubes provide fast access to precomputed,
summarized data, thereby benefiting online analytical processing as
well as data mining.
 The lowest level of a data cube (base cuboid)
 The aggregated data for an individual entity of interest
 Multiple levels of aggregation in data cubes
 Further reduce the size of data to deal with
 Reference appropriate levels
 Use the smallest
representation which is
enough to solve the task
 Queries regarding
aggregated information
should be answered using
data cube, when possible
Data Mining: Concepts and Techniques 39
Discretization and Concept hierarchy
 Discretization
 reduce the number of values for a given continuous
attribute by dividing the range of the attribute into
intervals. Interval labels can then be used to replace
actual data values. (e.g. age are replaced by interval labels :0–
10, 11–20, etc.)
 Concept hierarchies
 reduce the data by collecting and replacing low level
concepts (such as numeric values for the attribute
age) by higher level concepts (such as young,
middle-aged, or senior).

More Related Content

PPT
Datapreprocessingppt
PPT
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
PPT
data warehousing & minining 1st unit
PPT
Data preprocessing
PPTX
Introduction to dm and dw
PPT
Datapreprocess
PPT
DM Lecture 3
PDF
Statistics and Data Mining
Datapreprocessingppt
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
data warehousing & minining 1st unit
Data preprocessing
Introduction to dm and dw
Datapreprocess
DM Lecture 3
Statistics and Data Mining

What's hot (9)

PPT
Data preparation
DOC
Data Mining: Data Preprocessing
PPT
Data1
PPTX
Data preprocessing
PPT
Data preprocessing
PPT
Data Mining
PPT
Data preprocessing ng
PPT
Data preprocessing
PPT
Data preprocessing
Data preparation
Data Mining: Data Preprocessing
Data1
Data preprocessing
Data preprocessing
Data Mining
Data preprocessing ng
Data preprocessing
Data preprocessing
Ad

Similar to Data processing (20)

PPT
Konsep dan teknik dataminging bagian 3.ppt
PPT
DataMining Concept and techniue+datascie
PPT
datapreporcess_data scien eeee eeeee.ppt
PPT
My3prep
PPT
data mining concepts and techniques and systems
PPT
Pre processing
PPT
summarized best pre-processing techniques
PPT
DATA MININ _ TECHNOLOGY AND TECHNIQUE.ppt
PDF
Preprocessing
PPT
5810341.ppt
PPT
Preprocessing data mining hhxdzsdsasaasa
PPTX
Assignmentdatamining
PPT
Data preprocessing ng
PPT
Data preprocess
PPT
UNIT 1_2.ppt
PPT
Data PreProcessing
PPT
DataPreProcessing
PPT
Preprocessing
PPT
preproccessing level 3 for students.ppt
Konsep dan teknik dataminging bagian 3.ppt
DataMining Concept and techniue+datascie
datapreporcess_data scien eeee eeeee.ppt
My3prep
data mining concepts and techniques and systems
Pre processing
summarized best pre-processing techniques
DATA MININ _ TECHNOLOGY AND TECHNIQUE.ppt
Preprocessing
5810341.ppt
Preprocessing data mining hhxdzsdsasaasa
Assignmentdatamining
Data preprocessing ng
Data preprocess
UNIT 1_2.ppt
Data PreProcessing
DataPreProcessing
Preprocessing
preproccessing level 3 for students.ppt
Ad

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Institutional Correction lecture only . . .
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Business Ethics Teaching Materials for college
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial disease of the cardiovascular and lymphatic systems
TR - Agricultural Crops Production NC III.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Institutional Correction lecture only . . .
Renaissance Architecture: A Journey from Faith to Humanism
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
01-Introduction-to-Information-Management.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Business Ethics Teaching Materials for college
Final Presentation General Medicine 03-08-2024.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPH.pptx obstetrics and gynecology in nursing
Anesthesia in Laparoscopic Surgery in India
Week 4 Term 3 Study Techniques revisited.pptx

Data processing

  • 1. Data Preprocessing Lecture 3 Data Mining: Concepts and Techniques 1
  • 2. Data Mining: Concepts and Techniques 2  Why preprocess the data?  Data cleaning  Data integration and transformation  Data reduction  Discretization and concept hierarchy generation
  • 3. Data Mining: Concepts and Techniques 3 Why Data Preprocessing?  Data in the real world is dirty  incomplete: lacking attribute values, lacking certain attributes of interest, or containing only aggregate data  e.g., occupation=“ ”  noisy: containing errors or outliers  e.g., Salary=“-10”  inconsistent: containing discrepancies in codes or names  e.g., Age=“42” Birthday=“03/07/1997”  e.g., Was rating “1,2,3”, now rating “A, B, C”  e.g., discrepancy between duplicate records
  • 4. Data Mining: Concepts and Techniques 4 Why Is Data Dirty?  Incomplete data may come from  “Not applicable” data value when collected  Different considerations between the time when the data was collected and when it is analyzed.  Human/hardware/software problems  Noisy data (incorrect values) may come from  Faulty data collection instruments  Human or computer error at data entry  Errors in data transmission  Inconsistent data may come from  Different data sources  Functional dependency violation (e.g., modify some linked data)  Duplicate records also need data cleaning
  • 5. Data Mining: Concepts and Techniques 5 Why Is Data Preprocessing Important?  No quality data, no quality mining results!  Quality decisions must be based on quality data  e.g., duplicate or missing data may cause incorrect or even misleading statistics.  Data warehouse needs consistent integration of quality data  Data extraction, cleaning, and transformation comprises the majority of the work of building a data warehouse
  • 6. Data Mining: Concepts and Techniques 6 Multi-Dimensional Measure of Data Quality  A well-accepted multidimensional view:  Accuracy  Completeness  Consistency  Timeliness  Believability  Value added  Interpretability  Accessibility  Broad categories:  Intrinsic, contextual, representational, and accessibility
  • 7. Data Mining: Concepts and Techniques 7 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 transformation  Normalization and aggregation  Data reduction  Obtains reduced representation in volume but produces the same or similar analytical results  Data discretization  Part of data reduction but with particular importance, especially for numerical data
  • 8. Data Mining: Concepts and Techniques 8 Forms of Data Preprocessing
  • 9. Data Mining: Concepts and Techniques 9 Data Cleaning  Importance  “Data cleaning is one of the three biggest problems in data warehousing”—Ralph Kimball  “Data cleaning is the number one problem in data warehousing”—DCI survey  Data cleaning tasks  Fill in missing values  Identify outliers and smooth out noisy data  Correct inconsistent data  Resolve redundancy caused by data integration
  • 10. Data Mining: Concepts and Techniques 10 Missing Data  Data is not always available  E.g., many tuples have no recorded value for several attributes, such as customer income in sales data  Missing data may be due to  equipment malfunction  inconsistent with other recorded data and thus deleted  data not entered due to misunderstanding  certain data may not be considered important at the time of entry  not register history or changes of the data  Missing data may need to be inferred.
  • 11. Data Mining: Concepts and Techniques 11 How to Handle Missing Data?  Ignore the tuple: usually done when class label is missing (assuming the tasks in classification—not effective when the percentage 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?!  the attribute mean  the attribute mean for all samples belonging to the same class: smarter  the most probable value: inference-based such as Bayesian formula or decision tree
  • 12. Data Mining: Concepts and Techniques 12 Noisy Data  Noise: random error or variance in a measured variable  Incorrect attribute values may due to  faulty data collection instruments  data entry problems  data transmission problems  technology limitation  inconsistency in naming convention  Other data problems which requires data cleaning  duplicate records  incomplete data  inconsistent data
  • 13. Data Mining: Concepts and Techniques 13 How to Handle Noisy Data?  Binning  first sort data and partition into (equal-frequency) bins  then one can smooth by bin means, smooth by bin median, smooth by bin boundaries, etc.  Regression  smooth by fitting the data into regression functions  Clustering  detect and remove outliers  Combined computer and human inspection  detect suspicious values and check by human (e.g., deal with possible outliers)
  • 14. Data Mining: Concepts and Techniques 14 Simple Discretization Methods: Binning  Equal-width (distance) partitioning  Divides the range into N intervals of equal size: uniform grid  if A and B are the lowest and highest values of the attribute, the width of intervals will be: W = (B –A)/N.  The most straightforward, but outliers may dominate presentation  Skewed data is not handled well  Equal-depth (frequency) partitioning  Divides the range into N intervals, each containing approximately same number of samples  Good data scaling  Managing categorical attributes can be tricky
  • 15.  Example: Data Mining: Concepts and Techniques 15
  • 16. Data Mining: Concepts and Techniques 16 Binning Methods for Data Smoothing  Sorted data for price (in dollars): 4, 8, 9, 15, 21, 21, 24, 25, 26, 28, 29, 34 * Partition into equal-frequency (equi-depth) bins: - Bin 1: 4, 8, 9, 15 - Bin 2: 21, 21, 24, 25 - Bin 3: 26, 28, 29, 34 * Smoothing by bin means: - Bin 1: 9, 9, 9, 9 - Bin 2: 23, 23, 23, 23 - Bin 3: 29, 29, 29, 29 * Smoothing by bin boundaries: - Bin 1: 4, 4, 4, 15 - Bin 2: 21, 21, 25, 25 - Bin 3: 26, 26, 26, 34
  • 17.  Suppose the data for analysis includes the attribute Age. The age values for the data tuples (instances) are (in increasing order): 13, 15, 16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25, 25,30, 33, 33, 35, 35, 35, 35, 36, 40, 45, 46, 52, 70.  Use binning (by bin means) to smooth the above data using a bin data, depth of 3. Data Mining: Concepts and Techniques 17
  • 18. Data Mining: Concepts and Techniques 18 Regression x y y = x + 1 X1 Y1 Y1’
  • 19. Data Mining: Concepts and Techniques 19 Cluster Analysis
  • 20. Data Mining: Concepts and Techniques 20 Data Integration  Data integration:  Combines data from multiple sources into a coherent store  Schema integration: e.g., A.cust-id ≡ B.cust-#  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
  • 21. Data Mining: Concepts and Techniques 21 Handling Redundancy in Data Integration  Redundant data occur often when integration of multiple databases  Object identification: The same attribute or object may have different names in different databases  Derivable data: One attribute may be a “derived” attribute in another table, e.g., annual revenue  Redundant attributes may be able to be detected by correlation analysis  For nominal data, we use the chi-square test. For numeric attributes, we can use the correlation coefficient and covariance.  Careful integration of the data from multiple sources may help reduce/avoid redundancies and inconsistencies and improve mining speed and quality
  • 22. Data Mining: Concepts and Techniques 22 Data Transformation  Smoothing: remove noise from data  Aggregation: summarization, data cube construction  Generalization: concept hierarchy climbing  Normalization: scaled to fall within a small, specified range  min-max normalization  z-score normalization  normalization by decimal scaling  Attribute/feature construction  New attributes constructed from the given ones
  • 23. Data Mining: Concepts and Techniques 23 Data Transformation: Normalization  Min-max normalization: to [new_minA, new_maxA]  Ex. Let income range $12,000 to $98,000 normalized to [0.0, 1.0]. Then $73,000 is mapped to  Z-score normalization (μ: mean, σ: standard deviation):  Ex. Let μ = 54,000, σ = 16,000. Then  Normalization by decimal scaling 716.00)00.1( 000,12000,98 000,12600,73 =+− − − AAA AA A minnewminnewmaxnew minmax minv v _)__(' +− − − = A Av v σ µ− =' j v v 10 '= Where j is the smallest integer such that Max(|ν’|) < 1 225.1 000,16 000,54600,73 = −
  • 24. Data Mining: Concepts and Techniques 24 Data Reduction Strategies  Why data reduction?  A database/data warehouse may store terabytes of data  Complex data analysis/mining may take a very long time to run on the complete data set  Data reduction  Obtain a reduced representation of the data set that is much smaller in volume but yet produce the same (or almost the same) analytical results
  • 25. Data reduction strategies  Dimensionality reduction — e.g., remove unimportant attributes  Wavelet transforms and principal components analysis which transform or project the original data onto a smaller space. Attribute subset selection is a method of dimensionality reduction in which irrelevant, weakly relevant, or redundant attributes or dimensions are detected and removed .  Numerosity reduction — e.g., fit data into models  replace the original data volume by alternative, smaller forms of data representation. These techniques may be parametric or nonparametric. For parametric methods, a model is used to estimate the data, so that typically only the data parameters need to be stored, instead of the actual data. Regression and log-linear models are examples. Nonparametric methods for storing reduced representations of the data include histograms, clustering, sampling, and data cube aggregation  Data compression  Dimensionality reduction and numerosity reduction techniques can also be considered forms of data compression. Data Mining: Concepts and Techniques 25
  • 26. Data Mining: Concepts and Techniques 26 Attribute Subset Selection  Feature selection (i.e., attribute subset selection):  Select a minimum set of features such that the probability distribution of different classes given the values for those features is as close as possible to the original distribution given the values of all features  reduce # of patterns in the patterns, easier to understand  Heuristic methods (due to exponential # of choices):  Step-wise forward selection  Step-wise backward elimination  Combining forward selection and backward elimination  Decision-tree induction
  • 27. Data Mining: Concepts and Techniques 27 Heuristic Feature Selection Methods  There are 2d possible sub-features of d features  Several heuristic feature selection methods:  Best single features under the feature independence assumption: choose by significance tests  Best step-wise feature selection:  The best single-feature is picked first  Then next best feature condition to the first, ...  Step-wise feature elimination:  Repeatedly eliminate the worst feature  Best combined feature selection and elimination
  • 28. Data Mining: Concepts and Techniques 28 Example of Decision Tree Induction Initial attribute set: {A1, A2, A3, A4, A5, A6} A4 ? A1? A6? Class 1 Class 2 Class 1 Class 2 > Reduced attribute set: {A1, A4, A6}
  • 29. Numerosity Reduction  Parametric methods  Assume the data fits some model, estimate model parameters, store only the parameters, and discard the data (except possible outliers)  Example: Regression, Log-linear models  Non-parametric methods  Do not assume models  Major families: histograms, clustering, sampling
  • 30. Histograms  A popular data reduction technique  Divide data into buckets and store average (or sum) for each bucket 0 5 10 15 20 25 30 35 40 10000 30000 50000 70000 90000
  • 31. Histogram types  Equal-width: In an equal-width histogram, the width of each bucket range is uniform  Equal-frequency (or equal-depth): In an equal-frequency histogram, the buckets are created so that, roughly, the frequency of each bucket is constant (i.e., each bucket contains roughly the same number of contiguous data samples). Example:  not yet in school: 2  in primary school: 5  in high school: 9
  • 32. Clustering  Partitions data set into clusters, and models it by one representative from each cluster  Can be very effective if data is clustered but not if data is “smeared”
  • 33. Sampling  Sampling can be used as a data reduction technique because it allows a large data set to be represented by a much smaller random data sample (or subset). Suppose that a large data set, D, contains N tuples.  Simple random sample without replacement (SRSWOR) of size s: This is created by drawing s of the N tuples from D (s < N), where the probability of drawing any tuple in D is 1=N, that is, all tuples are equally likely to be sampled.  Simple random sample with replacement (SRSWR) of size s: This is similar to SRSWOR, except that each time a tuple is drawn from D, it is recorded and then replaced. That is, after a tuple is drawn, it is placed back in D so that it may be drawn again.
  • 35. Sampling Raw Data Cluster/Stratified Sample •The number of samples drawn from each cluster/stratum is analogous to its size •Thus, the samples represent better the data and outliers are avoided
  • 36. Data Mining: Concepts and Techniques 38 Data Cube Aggregation  Concept hierarchies may exist for each attribute, allowing the analysis of data at multiple abstraction levels. For example, a hierarchy for branch could allow branches to be grouped into regions, based on their address. Data cubes provide fast access to precomputed, summarized data, thereby benefiting online analytical processing as well as data mining.  The lowest level of a data cube (base cuboid)  The aggregated data for an individual entity of interest  Multiple levels of aggregation in data cubes  Further reduce the size of data to deal with
  • 37.  Reference appropriate levels  Use the smallest representation which is enough to solve the task  Queries regarding aggregated information should be answered using data cube, when possible Data Mining: Concepts and Techniques 39
  • 38. Discretization and Concept hierarchy  Discretization  reduce the number of values for a given continuous attribute by dividing the range of the attribute into intervals. Interval labels can then be used to replace actual data values. (e.g. age are replaced by interval labels :0– 10, 11–20, etc.)  Concept hierarchies  reduce the data by collecting and replacing low level concepts (such as numeric values for the attribute age) by higher level concepts (such as young, middle-aged, or senior).

Editor's Notes

  • #24: Example: suppose the range of attribute X is 500 to 45. The maximum absolute value of X is 500. To normalize by decimal scaling we will divide each value by 1,000 (c= 3). In this case, 500 becomes 0.5 while 45 will become 0.045.