SlideShare ist ein Scribd-Unternehmen logo
1 von 32
DATA PREPROCESSING

1


Why preprocess the data?



Descriptive data summarization



Data cleaning



Data integration and transformation



Data reduction



Discretization and concept hierarchy generation
2


Data in the real world is dirty


incomplete: lacking attribute values, lacking
certain attributes of interest, or containing only
aggregate data




noisy: containing errors or outliers




e.g., occupation=“ ”
e.g., Salary=“-10”

inconsistent: containing discrepancies in codes
or names



e.g., Age=“42” Birthday=“03/07/1997”
e.g., discrepancy between duplicate records
3


Incomplete data may come from







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





“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

Different data sources
Functional dependency violation (e.g., modify some linked data)

Duplicate records also need data cleaning
4


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




5


Data cleaning




Data integration




Normalization and aggregation

Data reduction




Integration of multiple databases, data cubes, or files

Data transformation




Fill in missing values, smooth noisy data, identify or remove outliers,
and resolve inconsistencies

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
6
7
Descriptive Data summarization

8


Motivation




Data dispersion characteristics




To better understand the data: central tendency, variation and
spread
median, max, min, quantiles, outliers, variance, etc.

Numerical dimensions correspond to sorted intervals





Data dispersion: analyzed with multiple granularities of precision
Boxplot or quantile analysis on sorted intervals

Dispersion analysis on computed measures


Folding measures into numerical dimensions



Boxplot or quantile analysis on the transformed cube
9
Quartiles, outliers and boxplots





Quartiles: Q1 (25th percentile), Q3 (75th percentile)



Inter-quartile range: IQR = Q3 – Q1



Five number summary: min, Q1, M, Q3, max



Boxplot: ends of the box are the quartiles, median is marked, whiskers, and plot
outlier individually



1
Outlier: usually, a value higher/lower than 1.5σx IQR∑ ( x − µ )
=

n

2

N

i =1

i

2

=

1
N

n

∑x
i =1

i

2

− µ2

Variance and standard deviation (sample: s, population: σ)





Variance: (algebraic, scalable computation)

1 n
1 n 2 1 n
2
s =
∑1 ( xi − x ) = n − 1 [∑1 xi − n (∑1 xi ) 2 ]
n − 1 i=
i=
i=
2



Standard deviation s (or σ) is the square root of variance s2 (or σ2)
10


Five-number summary of a distribution:
Minimum, Q1, M, Q3, Maximum



Boxplot


Data is represented with a box



The ends of the box are at the first and third
quartiles, i.e., the height of the box is IRQ



The median is marked by a line within the box



Whiskers: two lines outside the box extend to
Minimum and Maximum

11
12
Data cleaning

13


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
14


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



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




equipment malfunction

not register history or changes of the data

Missing data may need to be inferred.

15


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

16





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
17








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)
18


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
19
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


20
y
Y1

y=x+1

Y1’

X1

x

21
22
Data Integration and Transformation

23








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
24


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



Careful integration of the data from multiple sources may
help reduce/avoid redundancies and inconsistencies and
improve mining speed and quality
25







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

26
Data Reduction

27






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
 Data cube aggregation:
 Dimensionality reduction — e.g., remove unimportant attributes
 Data Compression
 Numerosity reduction — e.g., fit data into models
 Discretization and concept hierarchy generation
28


The lowest level of a data cube (base cuboid)





The aggregated data for an individual entity of interest
E.g., a customer in a phone calling data warehouse

Multiple levels of aggregation in data cubes




Reference appropriate levels




Further reduce the size of data to deal with
Use the smallest representation which is enough to solve
the task

Queries regarding aggregated information should be
answered using data cube, when possible
29




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

30



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
 Optimal branch and bound:
 Use feature elimination and backtracking
31
THANK YOU

32

Weitere ähnliche Inhalte

Was ist angesagt?

Data preprocessing
Data preprocessingData preprocessing
Data preprocessingHarry Potter
 
Data Mining: Concepts and Techniques — Chapter 2 —
Data Mining:  Concepts and Techniques — Chapter 2 —Data Mining:  Concepts and Techniques — Chapter 2 —
Data Mining: Concepts and Techniques — Chapter 2 —Salah Amean
 
Data preprocessing PPT
Data preprocessing PPTData preprocessing PPT
Data preprocessing PPTANUSUYA T K
 
Customer Clustering For Retail Marketing
Customer Clustering For Retail MarketingCustomer Clustering For Retail Marketing
Customer Clustering For Retail MarketingJonathan Sedar
 
Introduction to dm and dw
Introduction to dm and dwIntroduction to dm and dw
Introduction to dm and dwANUSUYA T K
 
Customer Segmentation with R - Deep Dive into flexclust
Customer Segmentation with R - Deep Dive into flexclustCustomer Segmentation with R - Deep Dive into flexclust
Customer Segmentation with R - Deep Dive into flexclustJim Porzak
 
Decision trees
Decision treesDecision trees
Decision treesNcib Lotfi
 
Data preprocessing in Data Mining
Data preprocessing  in Data MiningData preprocessing  in Data Mining
Data preprocessing in Data MiningSamad Baseer Khan
 

Was ist angesagt? (13)

Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
4 preprocess
4 preprocess4 preprocess
4 preprocess
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data Mining: Concepts and Techniques — Chapter 2 —
Data Mining:  Concepts and Techniques — Chapter 2 —Data Mining:  Concepts and Techniques — Chapter 2 —
Data Mining: Concepts and Techniques — Chapter 2 —
 
Cs501 data preprocessingdw
Cs501 data preprocessingdwCs501 data preprocessingdw
Cs501 data preprocessingdw
 
Data preprocessing PPT
Data preprocessing PPTData preprocessing PPT
Data preprocessing PPT
 
Data For Datamining
Data For DataminingData For Datamining
Data For Datamining
 
Customer Clustering For Retail Marketing
Customer Clustering For Retail MarketingCustomer Clustering For Retail Marketing
Customer Clustering For Retail Marketing
 
Introduction to dm and dw
Introduction to dm and dwIntroduction to dm and dw
Introduction to dm and dw
 
Data Mining
Data MiningData Mining
Data Mining
 
Customer Segmentation with R - Deep Dive into flexclust
Customer Segmentation with R - Deep Dive into flexclustCustomer Segmentation with R - Deep Dive into flexclust
Customer Segmentation with R - Deep Dive into flexclust
 
Decision trees
Decision treesDecision trees
Decision trees
 
Data preprocessing in Data Mining
Data preprocessing  in Data MiningData preprocessing  in Data Mining
Data preprocessing in Data Mining
 

Andere mochten auch

Museumgeologi 130427165857-phpapp02
Museumgeologi 130427165857-phpapp02Museumgeologi 130427165857-phpapp02
Museumgeologi 130427165857-phpapp02Houw Liong The
 
1.2 steps and functionalities
1.2 steps and functionalities1.2 steps and functionalities
1.2 steps and functionalitiesRajendran
 
Memory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureMemory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureShweta Ghate
 
computer virus and related legal issues
computer virus and related legal issuescomputer virus and related legal issues
computer virus and related legal issuesShweta Ghate
 
Data mining technique (decision tree)
Data mining technique (decision tree)Data mining technique (decision tree)
Data mining technique (decision tree)Shweta Ghate
 

Andere mochten auch (7)

Museumgeologi 130427165857-phpapp02
Museumgeologi 130427165857-phpapp02Museumgeologi 130427165857-phpapp02
Museumgeologi 130427165857-phpapp02
 
1.2 steps and functionalities
1.2 steps and functionalities1.2 steps and functionalities
1.2 steps and functionalities
 
Ghhh
GhhhGhhh
Ghhh
 
Memory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureMemory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer Architechture
 
computer virus and related legal issues
computer virus and related legal issuescomputer virus and related legal issues
computer virus and related legal issues
 
Data mining technique (decision tree)
Data mining technique (decision tree)Data mining technique (decision tree)
Data mining technique (decision tree)
 
Data Preprocessing
Data PreprocessingData Preprocessing
Data Preprocessing
 

Ähnlich wie Datapreprocessing

Pre_processing_the_data_using_advance_technique
Pre_processing_the_data_using_advance_techniquePre_processing_the_data_using_advance_technique
Pre_processing_the_data_using_advance_techniqueBhushan134837
 
1.6.data preprocessing
1.6.data preprocessing1.6.data preprocessing
1.6.data preprocessingKrish_ver2
 
data processing.pdf
data processing.pdfdata processing.pdf
data processing.pdfDimpyJindal4
 
Data preprocessing ng
Data preprocessing   ngData preprocessing   ng
Data preprocessing ngsaranya12345
 
Data preprocessing in Data Mining
Data preprocessing in Data MiningData preprocessing in Data Mining
Data preprocessing in Data MiningDHIVYADEVAKI
 
Data preperation
Data preperationData preperation
Data preperationFraboni Ec
 
prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...
prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...
prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...ImXaib
 
Data preparation
Data preparationData preparation
Data preparationTony Nguyen
 
Data preparation
Data preparationData preparation
Data preparationJames Wong
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingkayathri02
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingTony Nguyen
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingJames Wong
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingFraboni Ec
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingHoang Nguyen
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingYoung Alista
 

Ähnlich wie Datapreprocessing (20)

Pre_processing_the_data_using_advance_technique
Pre_processing_the_data_using_advance_techniquePre_processing_the_data_using_advance_technique
Pre_processing_the_data_using_advance_technique
 
1.6.data preprocessing
1.6.data preprocessing1.6.data preprocessing
1.6.data preprocessing
 
Data processing
Data processingData processing
Data processing
 
data processing.pdf
data processing.pdfdata processing.pdf
data processing.pdf
 
Data preprocessing ng
Data preprocessing   ngData preprocessing   ng
Data preprocessing ng
 
Data preprocessing ng
Data preprocessing   ngData preprocessing   ng
Data preprocessing ng
 
Data preprocessing in Data Mining
Data preprocessing in Data MiningData preprocessing in Data Mining
Data preprocessing in Data Mining
 
Data preperation
Data preperationData preperation
Data preperation
 
Data preperation
Data preperationData preperation
Data preperation
 
Data preperation
Data preperationData preperation
Data preperation
 
Data preparation
Data preparationData preparation
Data preparation
 
prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...
prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...
prvg4sczsginx3ynyqlc-signature-b84f0cf1da1e7d0fde4ecfab2a28f243cfa561f9aa2c9b...
 
Data preparation
Data preparationData preparation
Data preparation
 
Data preparation
Data preparationData preparation
Data preparation
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 

Kürzlich hochgeladen

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Kürzlich hochgeladen (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Datapreprocessing

  • 2.  Why preprocess the data?  Descriptive data summarization  Data cleaning  Data integration and transformation  Data reduction  Discretization and concept hierarchy generation 2
  • 3.  Data in the real world is dirty  incomplete: lacking attribute values, lacking certain attributes of interest, or containing only aggregate data   noisy: containing errors or outliers   e.g., occupation=“ ” e.g., Salary=“-10” inconsistent: containing discrepancies in codes or names   e.g., Age=“42” Birthday=“03/07/1997” e.g., discrepancy between duplicate records 3
  • 4.  Incomplete data may come from     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    “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 Different data sources Functional dependency violation (e.g., modify some linked data) Duplicate records also need data cleaning 4
  • 5.  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   5
  • 6.  Data cleaning   Data integration   Normalization and aggregation Data reduction   Integration of multiple databases, data cubes, or files Data transformation   Fill in missing values, smooth noisy data, identify or remove outliers, and resolve inconsistencies 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 6
  • 7. 7
  • 9.  Motivation   Data dispersion characteristics   To better understand the data: central tendency, variation and spread median, max, min, quantiles, outliers, variance, etc. Numerical dimensions correspond to sorted intervals    Data dispersion: analyzed with multiple granularities of precision Boxplot or quantile analysis on sorted intervals Dispersion analysis on computed measures  Folding measures into numerical dimensions  Boxplot or quantile analysis on the transformed cube 9
  • 10. Quartiles, outliers and boxplots   Quartiles: Q1 (25th percentile), Q3 (75th percentile)  Inter-quartile range: IQR = Q3 – Q1  Five number summary: min, Q1, M, Q3, max  Boxplot: ends of the box are the quartiles, median is marked, whiskers, and plot outlier individually  1 Outlier: usually, a value higher/lower than 1.5σx IQR∑ ( x − µ ) = n 2 N i =1 i 2 = 1 N n ∑x i =1 i 2 − µ2 Variance and standard deviation (sample: s, population: σ)   Variance: (algebraic, scalable computation) 1 n 1 n 2 1 n 2 s = ∑1 ( xi − x ) = n − 1 [∑1 xi − n (∑1 xi ) 2 ] n − 1 i= i= i= 2  Standard deviation s (or σ) is the square root of variance s2 (or σ2) 10
  • 11.  Five-number summary of a distribution: Minimum, Q1, M, Q3, Maximum  Boxplot  Data is represented with a box  The ends of the box are at the first and third quartiles, i.e., the height of the box is IRQ  The median is marked by a line within the box  Whiskers: two lines outside the box extend to Minimum and Maximum 11
  • 12. 12
  • 14.  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 14
  • 15.  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   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   equipment malfunction not register history or changes of the data Missing data may need to be inferred. 15
  • 16.  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 16
  • 17.    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 17
  • 18.     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) 18
  • 19.  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 19
  • 20. 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  20
  • 22. 22
  • 23. Data Integration and Transformation 23
  • 24.     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 24
  • 25.  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  Careful integration of the data from multiple sources may help reduce/avoid redundancies and inconsistencies and improve mining speed and quality 25
  • 26.      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 26
  • 28.    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  Data cube aggregation:  Dimensionality reduction — e.g., remove unimportant attributes  Data Compression  Numerosity reduction — e.g., fit data into models  Discretization and concept hierarchy generation 28
  • 29.  The lowest level of a data cube (base cuboid)    The aggregated data for an individual entity of interest E.g., a customer in a phone calling data warehouse Multiple levels of aggregation in data cubes   Reference appropriate levels   Further reduce the size of data to deal with Use the smallest representation which is enough to solve the task Queries regarding aggregated information should be answered using data cube, when possible 29
  • 30.   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 30
  • 31.   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  Optimal branch and bound:  Use feature elimination and backtracking 31