Training Dates: November 14-15, 21-22, and 28-29, 2019 (6 days total).
Data cleansing prepares data for model building, classifying data, handling missing values, and identifying outliers. For more details, please read on.

Data Engineer Job: Data Cleansing

Data is divided into two types:

– Categorical data grouping is divided into three subgroups: Ordinal (grouping numerical data in an orderly manner), Binary (grouping by alphabet), and Nominal (grouping by noun characteristics)

– Continuous numerical data

Data manipulation to enable analysis includes transforming nominal data by counting, converting sequential numerical data to ordinal data, dividing data into equal intervals, or counting the frequency of each interval

Dealing with Missing Values

Handling the target data for model building, for example, if we want to predict customer churn, we need data on customers who have churned and those who have not, divided into two groups. The amount of data used should be in a roughly equal proportion; we shouldn't use all customer data for the prediction

There are three ways to handle information that customers do not wish to disclose, such as income or salary, marital status, and credit bureau records:

– Replace missing values ​​with similar values. For credit bureau reports, use the mean or median to replace missing values. For status reports, use the mode to replace missing values, and so on.
– Delete.
– Keep the information if it's important, but categorize it. For example, income; the absence of data means there's no income, perhaps the person is unemployed, etc.

Finding outliers and displaying their findings to highlight abnormalities in the data

Preparing data for analysis requires identifying anomalies and calculating them using the standard deviation (SD) or initial radius (IQR), as shown in the image

Image 1: Searching for anomalies

For detecting anomalies, Professor Phaisan recommends using IQR, which is more reliable than the standard deviation (SD)

Standardization is the process of scaling data to a range we want, such as [0, 1] or [-1, +1]. There are three methods:
1) Min/Max standardization as shown in Figure 2, 
2) Z-Score as shown in Figure 3,
and 3) Decimal scaling as shown in Figure 4.

Figure 2: Min/Max standardization
Image 3: Z-Score
Image 4: Decimal scaling

Scaling the data speeds up model building and ensures that each variable has equal importance

Lab: Handling missing data and finding anomalies using Python and Spark

For general data analysis, Weka or Python are recommended. For large datasets, Spark should be used, but it carries higher costs for personnel development and data storage

Compiled by Nuchanat Rongrong,
lecturer Dr. Phaisan Phadungwiang,
R&D BI Co., Ltd.

A collection of articles on Data Science Essential.

For more information, please contact us at https://demo.rdbi.co.th/contact/,
via our 
Line official account: @rdbi,
or email sales@rdbi.co.th.

Leave a comment

Your email address will not be shown to others. Required fields are marked *.

We use cookies to improve the performance and user experience of our website. You can find more details in our Privacy Policy and manage your privacy settings by clicking on Settings.

Set privacy settings

You can choose your cookie settings by enabling or disabling each type of cookie as needed, except for essential cookies

Accept all
Manage privacy
  • Essential cookies
    Always on

    These types of cookies are essential for the website to function properly, allowing you to use and visit the site normally. You cannot disable these cookies on our website

  • Analytics cookies

    These types of cookies collect information about your website usage to help us measure, improve, and enhance your user experience. If you do not consent to the use of these cookies, we will not be able to measure, improve, and develop the website

Save settings