DM Preprocessing Lec4,5
DM Preprocessing Lec4,5
Objects
variable, field, characteristic, or 5 No Divorced 95K Yes
feature 6 No Married 60K No
7 Yes Divorced 220K No
A collection of attributes describe 8 No Single 85K Yes
an object 9 No Married 75K No
instance
Types of Attributes
Discrete Attribute
– Has only a finite or countably infinite set of values
– Examples: zip codes, counts, or the set of words in a collection of
documents
– Often represented as integer variables.
– Note: binary attributes are a special case of discrete attributes
Continuous Attribute
– Has real numbers as attribute values
– Examples: temperature, height, or weight.
– Practically, real values can only be measured and represented using a
finite number of digits.
– Continuous attributes are typically represented as floating-point variables.
Data Quality
Examples:
– Same person with multiple email addresses
Data cleaning
– Process of dealing with duplicate data issues
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
Forms of Data Preprocessing
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
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
Y1
Y1’ y=x+1
X1 x
Data Cleaning : Cluster Analysis
Data Integration
Data integration:
– Combines data from multiple sources into a coherent store
∑( A − A)( B − B ) ∑( AB ) − n A B
rA, B = =
(n −1)σAσB (n −1)σAσB
The larger the Χ2 value, the more likely the variables are
related
The cells that contribute the most to the Χ2 value are
those whose actual count is very different from the
expected count
Correlation does not imply causality
– # of hospitals and # of car-theft in a city are correlated
– Both are causally linked to the third variable: population
Data Transformation
Attribute/feature construction
– New attributes constructed from the given ones
Data Transformation
: Normalization
Min-max normalization: to [new_minA, new_maxA]
v − minA
v' = (new _ maxA − new _ minA) + new _ minA
maxA − minA
– Ex. Let income range $12,000 to $98,000 normalized to [0.0, 1.0].
Then $73,000 is mapped to 73,600 − 12,000 (1.0 − 0) + 0 = 0.716
98,000 − 12,000
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
Purpose
– Data reduction
Reduce the number of attributes or objects
– Change of scale
Cities aggregated into regions, states, countries, etc
– More “stable” data
Aggregated data tends to have less variability
Data Reduction : Aggregation
Techniques
– Principle Component Analysis
– Singular Value Decomposition
– Others: supervised and non-linear techniques
Dimensionality Reduction : PCA
x2
x1
Dimensionality Reduction : PCA
x2
x1
Data Reduction
: Feature Subset Selection
Another way to reduce dimensionality of data
Redundant features
– duplicate much or all of the information contained in one or more
other attributes
– Example: purchase price of a product and the amount of sales tax
paid
Irrelevant features
– contain no information that is useful for the data mining task at
hand
– Example: students' ID is often irrelevant to the task of predicting
students' GPA
Data Reduction
: Feature Subset Selection
Techniques:
– Brute-force approch:
Try all possible feature subsets as input to data mining
algorithm
– Filter approaches:
Features are selected before data mining algorithm is run
– Wrapper approaches:
Use the data mining algorithm as a black box to find best subset
of attributes
Data Reduction
: Feature Creation
Create new attributes that can capture the important
information in a data set much more efficiently than the
original attributes