Study+Material+Unit 4+Data+Preprocessing+
Study+Material+Unit 4+Data+Preprocessing+
Data Preprocessing
Data preprocessing is the process of transforming raw data into an
understandable format. It is also an important step in data mining as we
cannot work with raw data. The quality of the data should be checked
before applying machine learning or data mining algorithms.
1. Data cleaning
2. Data integration
3. Data reduction
4. Data transformation
1|Page
Data cleaning:
Data cleaning is the process to remove incorrect data, incomplete data
and inaccurate data from the datasets, and it also replaces the missing
values. There are some techniques in data cleaning
Standard values like “Not Available” or “NA” can be used to replace the
missing values.
Missing values can also be filled manually but it is not recommended
when that dataset is big.
The attribute’s mean value can be used to replace the missing value
when the data is normally distributed
wherein in the case of non-normal distribution median value of the
attribute can be used.
While using regression or decision tree algorithms the missing value can
be replaced by the most probable
value.
2.Noisy:
Noisy generally means random error or containing unnecessary
data points. Here are some of the methods to handle noisy data.
Binning: This method is to smooth or handle noisy data. First, the data
is sorted then and then the sorted values are separated and stored in the
form of bins. There are three methods for smoothing data in the bin.
Smoothing by bin mean method: In this method, the values in the bin
are replaced by the mean value of the bin;
Smoothing by bin median: In this method, the values in the bin are
replaced by the median value;
Smoothing by bin boundary: In this method, the using minimum and
maximum values of the bin values are taken and the values are replaced
by the closest boundary value.
2|Page
3.Regression: This is used to smooth the data and will help to handle
data when unnecessary data is present. For the analysis, purpose
regression helps to decide the variable which is suitable for our analysis.
4. Clustering: This is used for finding the outliers and also in grouping
the data. Clustering is generally used in unsupervised learning.
Data integration:
The process of combining multiple sources into a single dataset.
The Data integration process is one of the main components in data
management. There are some problems to be considered during data
integration.
3.Detecting and resolving data value concepts: The data taken from
different databases while merging may differ. Like the attribute values
from one database may differ from another database. For example, the
date format may differ like “MM/DD/YYYY” or “DD/MM/YYYY”.
Data reduction:
This process helps in the reduction of the volume of the data which
makes the analysis easier yet produces the same or almost the same
result. This reduction also helps to reduce storage space. There are some
of the techniques in data reduction are Dimensionality reduction,
Numerosity reduction, Data compression.
3|Page
1.Dimensionality reduction: This process is necessary for real-world
applications as the data size is big. In this process, the reduction of
random variables or attributes is done so that the dimensionality of the
data set can be reduced. Combining and merging the attributes of the
data without losing its original characteristics. This also helps in the
reduction of storage space and computation time is reduced. When the
data is highly dimensional the problem called “Curse of Dimensionality”
occurs.
Data Transformation:
The change made in the format or the structure of the data is called
data transformation. This step can be simple or complex based on the
requirements. There are some methods in data transformation.
Z- Score Formula
10
15
20
5|Page
Mean = 13.25
Standard deviation = 4.6
8 -1.14
10 -0.7
15 0.3
20 1.4
6|Page
Min-Max Normalization
where:
The minimum value in the dataset is 13 and the maximum value is 71.
To normalize the first value of 13, we would apply the formula shared
earlier:
7|Page
zi = (xi – min(x)) / (max(x) – min(x)) = (13 – 13) / (71 – 13) = 0
To normalize the second value of 16, we would use the same formula:
To normalize the third value of 19, we would use the same formula:
We can use this exact same formula to normalize each value in the
original dataset to be between 0 and 1:
8|Page