SlideShare a Scribd company logo
國立臺北護理健康大學 NTUHS
Overview of data processing
Orozco Hsu
2021-10-25
1
About me
• Education
• NCU (MIS)、NCCU (CS)
• Work Experience
• Telecom big data Innovation
• AI projects
• Retail marketing technology
• User Group
• TW Spark User Group
• TW Hadoop User Group
• Taiwan Data Engineer Association Director
• Research
• Big Data/ ML/ AIOT/ AI Columnist
2
Tutorial
Content
3
Data Cleaning
Feather Transformation
Homework
Data Preprocessing
Standardization and Normalization
Code
• Download code
• https://github.com/orozcohsu/ntunhs_2021.git
• Folder
• 20211025_inter_master
4
Model building lifecycle
5
Data Preprocessing (1)
• 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.
6
Data Preprocessing (2)
• Preprocessing of data is mainly to check the data quality. The quality
can be checked by the following
• Accuracy: To check whether the data entered is correct or not.
• Completeness: To check whether the data is available or not recorded.
• Consistency: To check whether the same data is kept in all the places that do
or do not match.
• Timeliness: The data should be updated correctly.
• Believability: The data should be trustable.
• Interpretability: The understandability of the data.
7
Data Preprocessing (3)
• Major Tasks in Data Preprocessing
8
• Feature Transformation
• Polynomial feature
• Categorical feature
• Numerical feature
• Custom feature
• Standardization and Normalization
• Data cleaning
• Missing value
• Cut bins
• Data integration
• Data reduction
• Data transformation
Data Cleaning (1)
• Data cleaning is the process to remove incorrect data, incomplete
data and inaccurate data from the datasets, and it also replaces the
missing values.
9
Data Cleaning (2)
• Handling missing values:
• 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.
10
Data Cleaning (3)
• Noisy
Noisy generally means random error or containing unnecessary data points
• Binning: This method is to smooth or handle noisy data. 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.
• Clustering: This is used for finding the outliers and also in grouping the data.
11
Data Cleaning (4)
• Data Integration
The process of combining multiple sources into a single dataset.
• Database SQL join
• Python pandas join
12
Data Cleaning (5)
• Data Reduction:
Helps in the reduction of the data volume makes the analysis easier
• Dimensionality reduction: 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.
13
Homework: Try to explain what is Principal Components Analysis or Singular Value Decomposition
and why it does dimensionality reduction
Data Cleaning (6)
• Data Transformation
The change made in the format or the structure of the data
• Smoothing: By smoothing we can find even a simple change that helps in
prediction.
• Discretization: The continuous data here is split into intervals. Discretization
reduces the data size.
14
Demo Code
• Preprocessing_1.ipynb
• Preprocessing_2.ipynb
• Preprocessing_3.ipynb
• Preprocessing_4.ipynb
15
Feather Transformation (1)
• Interaction Features
Create new features from existing features and use common
knowledge in the field of data
• Feature add
• Feature sub
• Feature prod
• Feature div
16
Feather Transformation (1)
• Polynomial features
• Creating polynomial features is a simple and common way of feature
engineering that adds complexity to numeric input data by combining
features.
17
Feather Transformation (2)
• Categorical features
• Once you know what type of categorical data you’re working on, you can pick
a suiting transformation tool.
• In sklearn that will be a OrdinalEncoder for ordinal data, and a
OneHotEncoder for nominal data.
18
Feather Transformation (3)
• Numerical features
• Numerical features can be decoded into categorical features.
• The two most common ways to do this are discretization and binarization.
19
Feather Transformation (4)
• Custom transformers
• If you want to convert an existing function into a transformer to assist in data
cleaning or processing, you can implement a transformer from an arbitrary
function with FunctionTransformer.
• Or you can use lambda function to transform value.
20
Demo Code
• Feature_Transformation.ipynb
21
Standardization and Normalization (1)
• Before applying any scaling transformations it is very important to
split your data into a train set and a test set.
• Standard Scaler
• MinMax Scaler
• MaxAbs Scaler
• Robust Scaler
22
Standardization and Normalization (2)
• Standard Scaler
• It purely centers the data by using the following formula, where u is the mean
and s is the standard deviation.
23
Standardization and Normalization (3)
• MinMax Scaler
• The MinMaxScaler transforms features by scaling each feature to a given
range.
• This scaler works better for cases where the distribution is not Gaussian or
the standard deviation.
24
Standardization and Normalization (4)
• MaxAbs Scaler
• The MaxAbsScaler works very similarly to the MinMaxScaler but automatically
scales the data to a [-1,1] range based on the absolute maximum.
25
Standardization and Normalization (5)
• Robust Scaler
• If your data contains many outliers, scaling using the mean and standard
deviation of the data is likely to not work very well.
• In these cases, you can use the RobustScaler. It removes the median and
scales the data according to the quantile range.
26
Homework: Try to explain what is Z-Score Standardization
Standardization and Normalization (6)
• Normalization is the process of scaling individual samples to have unit
norm.
• l1 (l1 norm) : The l1 norm uses the sum of all the values as and thus gives
equal penalty to all parameters, enforcing sparsity.
• l2 (l2 norm): The l2 norm uses the square root of the sum of all the squared
values.
27
Demo Code
• Standardization_and_Normalization.ipynb
28
Homework
29
• Explanation of Z-score standardization
• Explanation of dimensionality reduction
• Preprocess dataset titanic (titanic.csv)
• Data cleaning
• Data standardization and normalization

More Related Content

PDF
6 data envelopment_analysis
 
PDF
4 visualization inter
 
PDF
A Firefly based improved clustering algorithm
PDF
A Semantic Web Platform for Automating the Interpretation of Finite Element ...
PPTX
A Beginner's Guide to Machine Learning with Scikit-Learn
PDF
GLM & GBM in H2O
PPTX
T. Yoon, et. al., ICLR 2021, MLILAB, KAIST AI
PPTX
Top 10 Data Science Practitioner Pitfalls
6 data envelopment_analysis
 
4 visualization inter
 
A Firefly based improved clustering algorithm
A Semantic Web Platform for Automating the Interpretation of Finite Element ...
A Beginner's Guide to Machine Learning with Scikit-Learn
GLM & GBM in H2O
T. Yoon, et. al., ICLR 2021, MLILAB, KAIST AI
Top 10 Data Science Practitioner Pitfalls

What's hot (13)

PPT
data mining
PPTX
Database Performance Analysis with Time Series
PDF
Building Data Products
PDF
Region-Based Search in Large Medical Image Repositories
PDF
Introduction to Data Mining - A Beginner's Guide
PDF
Azure Machine Learning and ML on Premises
PDF
Machine Learning Classifiers
PPTX
A Semantic Web Platform for Improving the Automation and Reproducibility of F...
PDF
Building a Predictive Model
PDF
Big Data Visualization Problem in IT Management
PDF
Performance Evaluation: A Comparative Study of Various Classifiers
PPTX
Linear regression on 1 terabytes of data? Some crazy observations and actions
data mining
Database Performance Analysis with Time Series
Building Data Products
Region-Based Search in Large Medical Image Repositories
Introduction to Data Mining - A Beginner's Guide
Azure Machine Learning and ML on Premises
Machine Learning Classifiers
A Semantic Web Platform for Improving the Automation and Reproducibility of F...
Building a Predictive Model
Big Data Visualization Problem in IT Management
Performance Evaluation: A Comparative Study of Various Classifiers
Linear regression on 1 terabytes of data? Some crazy observations and actions
Ad

Similar to overview of_data_processing (20)

PPTX
Pandas Data Cleaning and Preprocessing PPT.pptx
PPT
Preprocessing.ppt
PPTX
Data preprocessing in Machine learning
PDF
Data preprocessing in Machine Learning
PDF
ML-Unit-4.pdf
PPT
ML-ChapterTwo-Data Preprocessing.ppt
PPTX
Unit 4_Working with Graphs _python (2).pptx
PDF
KNOLX_Data_preprocessing
PDF
The model interacts with the environment seeking ways to maximize the reward....
PPT
Data preprocessing in precision agriculture
PPTX
DATA preprocessing.pptx
PDF
Introduction to Artificial Intelligence_ Lec 5
PPT
Data PreProcessing
PPT
DataPreProcessing
PPT
Preprocessing
PDF
IRJET - An User Friendly Interface for Data Preprocessing and Visualizati...
PPTX
Unit _2 Data Processing.pptx FOR THE DATA SCIENCE STUDENTSHE
PDF
Data preprocessing in Data Mining
PPT
1.6.data preprocessing
PPT
Chapter 2 Cond (1).ppt
Pandas Data Cleaning and Preprocessing PPT.pptx
Preprocessing.ppt
Data preprocessing in Machine learning
Data preprocessing in Machine Learning
ML-Unit-4.pdf
ML-ChapterTwo-Data Preprocessing.ppt
Unit 4_Working with Graphs _python (2).pptx
KNOLX_Data_preprocessing
The model interacts with the environment seeking ways to maximize the reward....
Data preprocessing in precision agriculture
DATA preprocessing.pptx
Introduction to Artificial Intelligence_ Lec 5
Data PreProcessing
DataPreProcessing
Preprocessing
IRJET - An User Friendly Interface for Data Preprocessing and Visualizati...
Unit _2 Data Processing.pptx FOR THE DATA SCIENCE STUDENTSHE
Data preprocessing in Data Mining
1.6.data preprocessing
Chapter 2 Cond (1).ppt
Ad

More from FEG (20)

PDF
Supervised learning in decision tree algorithm
 
PDF
Unsupervised learning in data clustering
 
PDF
CNN_Image Classification for deep learning.pdf
 
PDF
Sequence Model with practicing hands on coding.pdf
 
PDF
Seq2seq Model introduction with practicing hands on coding.pdf
 
PDF
AIGEN introduction with practicing hands on coding.pdf
 
PDF
資料視覺化_Exploation_Data_Analysis_20241015.pdf
 
PDF
Operation_research_Linear_programming_20241015.pdf
 
PDF
Operation_research_Linear_programming_20241112.pdf
 
PDF
非監督是學習_Kmeans_process_visualization20241110.pdf
 
PDF
Sequence Model pytorch at colab with gpu.pdf
 
PDF
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
 
PDF
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
 
PDF
Pytorch cnn netowork introduction 20240318
 
PDF
2023 Decision Tree analysis in business practices
 
PDF
2023 Clustering analysis using Python from scratch
 
PDF
2023 Data visualization using Python from scratch
 
PDF
2023 Supervised Learning for Orange3 from scratch
 
PDF
2023 Supervised_Learning_Association_Rules
 
PDF
202312 Exploration Data Analysis Visualization (English version)
 
Supervised learning in decision tree algorithm
 
Unsupervised learning in data clustering
 
CNN_Image Classification for deep learning.pdf
 
Sequence Model with practicing hands on coding.pdf
 
Seq2seq Model introduction with practicing hands on coding.pdf
 
AIGEN introduction with practicing hands on coding.pdf
 
資料視覺化_Exploation_Data_Analysis_20241015.pdf
 
Operation_research_Linear_programming_20241015.pdf
 
Operation_research_Linear_programming_20241112.pdf
 
非監督是學習_Kmeans_process_visualization20241110.pdf
 
Sequence Model pytorch at colab with gpu.pdf
 
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
 
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
 
Pytorch cnn netowork introduction 20240318
 
2023 Decision Tree analysis in business practices
 
2023 Clustering analysis using Python from scratch
 
2023 Data visualization using Python from scratch
 
2023 Supervised Learning for Orange3 from scratch
 
2023 Supervised_Learning_Association_Rules
 
202312 Exploration Data Analysis Visualization (English version)
 

Recently uploaded (20)

PPT
Project quality management in manufacturing
PDF
Well-logging-methods_new................
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
OOP with Java - Java Introduction (Basics)
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Sustainable Sites - Green Building Construction
PPTX
Construction Project Organization Group 2.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Project quality management in manufacturing
Well-logging-methods_new................
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Operating System & Kernel Study Guide-1 - converted.pdf
Foundation to blockchain - A guide to Blockchain Tech
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Geodesy 1.pptx...............................................
OOP with Java - Java Introduction (Basics)
Mechanical Engineering MATERIALS Selection
Sustainable Sites - Green Building Construction
Construction Project Organization Group 2.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx

overview of_data_processing

  • 1. 國立臺北護理健康大學 NTUHS Overview of data processing Orozco Hsu 2021-10-25 1
  • 2. About me • Education • NCU (MIS)、NCCU (CS) • Work Experience • Telecom big data Innovation • AI projects • Retail marketing technology • User Group • TW Spark User Group • TW Hadoop User Group • Taiwan Data Engineer Association Director • Research • Big Data/ ML/ AIOT/ AI Columnist 2
  • 3. Tutorial Content 3 Data Cleaning Feather Transformation Homework Data Preprocessing Standardization and Normalization
  • 4. Code • Download code • https://github.com/orozcohsu/ntunhs_2021.git • Folder • 20211025_inter_master 4
  • 6. Data Preprocessing (1) • 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. 6
  • 7. Data Preprocessing (2) • Preprocessing of data is mainly to check the data quality. The quality can be checked by the following • Accuracy: To check whether the data entered is correct or not. • Completeness: To check whether the data is available or not recorded. • Consistency: To check whether the same data is kept in all the places that do or do not match. • Timeliness: The data should be updated correctly. • Believability: The data should be trustable. • Interpretability: The understandability of the data. 7
  • 8. Data Preprocessing (3) • Major Tasks in Data Preprocessing 8 • Feature Transformation • Polynomial feature • Categorical feature • Numerical feature • Custom feature • Standardization and Normalization • Data cleaning • Missing value • Cut bins • Data integration • Data reduction • Data transformation
  • 9. Data Cleaning (1) • Data cleaning is the process to remove incorrect data, incomplete data and inaccurate data from the datasets, and it also replaces the missing values. 9
  • 10. Data Cleaning (2) • Handling missing values: • 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. 10
  • 11. Data Cleaning (3) • Noisy Noisy generally means random error or containing unnecessary data points • Binning: This method is to smooth or handle noisy data. 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. • Clustering: This is used for finding the outliers and also in grouping the data. 11
  • 12. Data Cleaning (4) • Data Integration The process of combining multiple sources into a single dataset. • Database SQL join • Python pandas join 12
  • 13. Data Cleaning (5) • Data Reduction: Helps in the reduction of the data volume makes the analysis easier • Dimensionality reduction: 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. 13 Homework: Try to explain what is Principal Components Analysis or Singular Value Decomposition and why it does dimensionality reduction
  • 14. Data Cleaning (6) • Data Transformation The change made in the format or the structure of the data • Smoothing: By smoothing we can find even a simple change that helps in prediction. • Discretization: The continuous data here is split into intervals. Discretization reduces the data size. 14
  • 15. Demo Code • Preprocessing_1.ipynb • Preprocessing_2.ipynb • Preprocessing_3.ipynb • Preprocessing_4.ipynb 15
  • 16. Feather Transformation (1) • Interaction Features Create new features from existing features and use common knowledge in the field of data • Feature add • Feature sub • Feature prod • Feature div 16
  • 17. Feather Transformation (1) • Polynomial features • Creating polynomial features is a simple and common way of feature engineering that adds complexity to numeric input data by combining features. 17
  • 18. Feather Transformation (2) • Categorical features • Once you know what type of categorical data you’re working on, you can pick a suiting transformation tool. • In sklearn that will be a OrdinalEncoder for ordinal data, and a OneHotEncoder for nominal data. 18
  • 19. Feather Transformation (3) • Numerical features • Numerical features can be decoded into categorical features. • The two most common ways to do this are discretization and binarization. 19
  • 20. Feather Transformation (4) • Custom transformers • If you want to convert an existing function into a transformer to assist in data cleaning or processing, you can implement a transformer from an arbitrary function with FunctionTransformer. • Or you can use lambda function to transform value. 20
  • 22. Standardization and Normalization (1) • Before applying any scaling transformations it is very important to split your data into a train set and a test set. • Standard Scaler • MinMax Scaler • MaxAbs Scaler • Robust Scaler 22
  • 23. Standardization and Normalization (2) • Standard Scaler • It purely centers the data by using the following formula, where u is the mean and s is the standard deviation. 23
  • 24. Standardization and Normalization (3) • MinMax Scaler • The MinMaxScaler transforms features by scaling each feature to a given range. • This scaler works better for cases where the distribution is not Gaussian or the standard deviation. 24
  • 25. Standardization and Normalization (4) • MaxAbs Scaler • The MaxAbsScaler works very similarly to the MinMaxScaler but automatically scales the data to a [-1,1] range based on the absolute maximum. 25
  • 26. Standardization and Normalization (5) • Robust Scaler • If your data contains many outliers, scaling using the mean and standard deviation of the data is likely to not work very well. • In these cases, you can use the RobustScaler. It removes the median and scales the data according to the quantile range. 26 Homework: Try to explain what is Z-Score Standardization
  • 27. Standardization and Normalization (6) • Normalization is the process of scaling individual samples to have unit norm. • l1 (l1 norm) : The l1 norm uses the sum of all the values as and thus gives equal penalty to all parameters, enforcing sparsity. • l2 (l2 norm): The l2 norm uses the square root of the sum of all the squared values. 27
  • 29. Homework 29 • Explanation of Z-score standardization • Explanation of dimensionality reduction • Preprocess dataset titanic (titanic.csv) • Data cleaning • Data standardization and normalization