Data Preprocessing. S1 Teknik Informatika Fakultas Teknologi Informasi Universitas Kristen Maranatha

Similar documents
Data Preprocessing. Why Data Preprocessing? MIT-652 Data Mining Applications. Chapter 3: Data Preprocessing. Multi-Dimensional Measure of Data Quality

CS6220: DATA MINING TECHNIQUES

Data Preprocessing. Slides by: Shree Jaswal

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3

Data Mining: Concepts and Techniques

Preprocessing Short Lecture Notes cse352. Professor Anita Wasilewska

UNIT 2 Data Preprocessing

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3. Chapter 3: Data Preprocessing. Major Tasks in Data Preprocessing

ECLT 5810 Data Preprocessing. Prof. Wai Lam

Data Preprocessing in Python. Prof.Sushila Aghav

3. Data Preprocessing. 3.1 Introduction

Chapter 2 Data Preprocessing

2. Data Preprocessing

Data Mining and Analytics. Introduction

Data Preprocessing Yudho Giri Sucahyo y, Ph.D , CISA

Data Mining: Concepts and Techniques. Chapter 2

CS570 Introduction to Data Mining

cse634 Data Mining Preprocessing Lecture Notes Chapter 2 Professor Anita Wasilewska

Data Preprocessing. Data Mining 1

Road Map. Data types Measuring data Data cleaning Data integration Data transformation Data reduction Data discretization Summary

UNIT 2. DATA PREPROCESSING AND ASSOCIATION RULES

By Mahesh R. Sanghavi Associate professor, SNJB s KBJ CoE, Chandwad

Jarek Szlichta

ECT7110. Data Preprocessing. Prof. Wai Lam. ECT7110 Data Preprocessing 1

CS 521 Data Mining Techniques Instructor: Abdullah Mueen

Data Mining. Data preprocessing. Hamid Beigy. Sharif University of Technology. Fall 1395

Data Mining. Data preprocessing. Hamid Beigy. Sharif University of Technology. Fall 1394

Data Preprocessing. Chapter Why Preprocess the Data?

K236: Basis of Data Science

Summary of Last Chapter. Course Content. Chapter 3 Objectives. Chapter 3: Data Preprocessing. Dr. Osmar R. Zaïane. University of Alberta 4

Data Mining Concepts & Techniques

DATA PREPROCESSING. Tzompanaki Katerina

CS378 Introduction to Data Mining. Data Exploration and Data Preprocessing. Li Xiong

Data Mining: Concepts and Techniques. Chapter 2

Information Management course

Acquisition Description Exploration Examination Understanding what data is collected. Characterizing properties of data.

Data Exploration and Preparation Data Mining and Text Mining (UIC Politecnico di Milano)

CS570: Introduction to Data Mining

Data Preprocessing. Erwin M. Bakker & Stefan Manegold.

Data Preparation. Data Preparation. (Data pre-processing) Why Prepare Data? Why Prepare Data? Some data preparation is needed for all mining tools

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3

Data Preprocessing. Komate AMPHAWAN

CHAPTER-13. Mining Class Comparisons: Discrimination between DifferentClasses: 13.4 Class Description: Presentation of Both Characterization and

Chapter 6: DESCRIPTIVE STATISTICS

Data Mining. Part 2. Data Understanding and Preparation. 2.4 Data Transformation. Spring Instructor: Dr. Masoud Yaghini. Data Transformation

BBS654 Data Mining. Pinar Duygulu. Slides are adapted from Nazli Ikizler, Sanjay Ranka

Getting to Know Your Data

IAT 355 Visual Analytics. Data and Statistical Models. Lyn Bartram

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 3

Table of Contents (As covered from textbook)

Measures of Dispersion

Chapter 2 Describing, Exploring, and Comparing Data

Data Mining MTAT

Data preprocessing Functional Programming and Intelligent Algorithms

UNIT 1A EXPLORING UNIVARIATE DATA

Data can be in the form of numbers, words, measurements, observations or even just descriptions of things.

Chapter 3 - Displaying and Summarizing Quantitative Data

A Survey on Data Preprocessing Techniques for Bioinformatics and Web Usage Mining

2. (a) Briefly discuss the forms of Data preprocessing with neat diagram. (b) Explain about concept hierarchy generation for categorical data.

Table Of Contents: xix Foreword to Second Edition

15 Wyner Statistics Fall 2013

Measures of Central Tendency. A measure of central tendency is a value used to represent the typical or average value in a data set.

Data Preprocessing UE 141 Spring 2013

CHAPTER 1. Introduction. Statistics: Statistics is the science of collecting, organizing, analyzing, presenting and interpreting data.

The first few questions on this worksheet will deal with measures of central tendency. These data types tell us where the center of the data set lies.

Prepare a stem-and-leaf graph for the following data. In your final display, you should arrange the leaves for each stem in increasing order.

To calculate the arithmetic mean, sum all the values and divide by n (equivalently, multiple 1/n): 1 n. = 29 years.

Math 120 Introduction to Statistics Mr. Toner s Lecture Notes 3.1 Measures of Central Tendency

STA 570 Spring Lecture 5 Tuesday, Feb 1

Data Collection, Preprocessing and Implementation

Chapter 3: Data Description - Part 3. Homework: Exercises 1-21 odd, odd, odd, 107, 109, 118, 119, 120, odd

Averages and Variation

Measures of Central Tendency

STP 226 ELEMENTARY STATISTICS NOTES PART 2 - DESCRIPTIVE STATISTICS CHAPTER 3 DESCRIPTIVE MEASURES

Data Preprocessing. Outline. Motivation. How did this happen?

Vocabulary. 5-number summary Rule. Area principle. Bar chart. Boxplot. Categorical data condition. Categorical variable.

Chapter 2. Descriptive Statistics: Organizing, Displaying and Summarizing Data

Contents. Foreword to Second Edition. Acknowledgments About the Authors

Frequency Distributions

2 CONTENTS. 3.8 Bibliographic Notes... 45

STA Rev. F Learning Objectives. Learning Objectives (Cont.) Module 3 Descriptive Measures

10.4 Measures of Central Tendency and Variation

10.4 Measures of Central Tendency and Variation

CHAPTER 2 DESCRIPTIVE STATISTICS

Slide Copyright 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION. Chapter 13. Statistics Sampling Techniques

Data Preprocessing. Data Mining: Concepts and Techniques. c 2012 Elsevier Inc. All rights reserved.

CHAPTER 3: Data Description

Part I, Chapters 4 & 5. Data Tables and Data Analysis Statistics and Figures

Course on Data Mining ( )

2.1: Frequency Distributions and Their Graphs

Chapter 1. Looking at Data-Distribution

Data Mining By IK Unit 4. Unit 4

Dta Mining and Data Warehousing

Math 214 Introductory Statistics Summer Class Notes Sections 3.2, : 1-21 odd 3.3: 7-13, Measures of Central Tendency

Things you ll know (or know better to watch out for!) when you leave in December: 1. What you can and cannot infer from graphs.

MATH 1070 Introductory Statistics Lecture notes Descriptive Statistics and Graphical Representation

Chpt 3. Data Description. 3-2 Measures of Central Tendency /40

CHAPTER 2: SAMPLING AND DATA

2.1 Objectives. Math Chapter 2. Chapter 2. Variable. Categorical Variable EXPLORING DATA WITH GRAPHS AND NUMERICAL SUMMARIES

Data Mining Chapter 3: Visualizing and Exploring Data Fall 2011 Ming Li Department of Computer Science and Technology Nanjing University

Transcription:

Data Preprocessing S1 Teknik Informatika Fakultas Teknologi Informasi Universitas Kristen Maranatha 1

Why Data Preprocessing? Data in the real world is dirty incomplete: lacking attribute values, lacking certain attributes of interest, or containing only aggregate data e.g., occupation= noisy: containing errors or outliers e.g., Salary= -10 inconsistent: containing discrepancies in codes or names e.g., Age= 42 Birthday= 03/07/1997 e.g., Was rating 1,2,3, now rating A, B, C e.g., discrepancy between duplicate records 2

Why is Data Dirty? Incomplete 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 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 Different data sources Functional dependency violation (e.g., modify some linked data) Duplicate records also need data cleaning 3

Why is Data preprocessing important? 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 4

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 5

Forms of Data Preprocessing 6

Data Descriptive 7

Mining Data Descriptive Characteristics Motivation To better understand the data: central tendency, variation and spread Data dispersion characteristics 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 8

Measuring the Central Tendency Mean (algebraic measure) (sample vs. population): Weighted arithmetic mean: Trimmed mean: chopping extreme values Median: A holistic measure x 1 x = n n i = 1 = n i = 1 w i w x i i n i = 1 x i µ = x N Middle value if odd number of values, or average of the middle two values otherwise Estimated by interpolation (for grouped data): Mode median Value that occurs most frequently in the data = L 1 n / 2 ( + ( f median f ) l ) c Unimodal, bimodal, trimodal Empirical formula: mean mode = 3 ( mean median) 9

Symmetric vs. Skewed Data Median, mean and mode of symmetric, positively and negatively skewed data Mean Median Mode 10

Measuring the Dispersion of Data Quartiles, outliers and boxplots Quartiles: Q 1 (25 th percentile), Q 3 (75 th percentile) Inter-quartile range: IQR = Q 3 Q 1 Five number summary: min, Q 1, M, Q 3, max Boxplot: ends of the box are the quartiles, median is marked, whiskers, and 11 plot outlier individually Outlier: usually, a value higher/lower than 1.5 x IQR Variance and standard deviation (sample: s, population: σ) Variance: (algebraic, scalable computation) Standard deviation s (or σ) is the square root of variance s 2 ( or σ 2) = = = = = n i n i i i n i i x n x n x x n s 1 1 2 2 1 2 2 ] ) ( 1 [ 1 1 ) ( 1 1 = = = = n i i n i i x N x N 1 2 2 1 2 2 1 ) ( 1 µ µ σ

Properties of Normal Distribution Curve The normal (distribution) curve From µ σ to µ+σ: contains about 68% of the measurements (µ: mean, σ: standard deviation) From µ 2σ to µ+2σ: contains about 95% of it From µ 3σ to µ+3σ: contains about 99.7% of it 68% 95% 99.7% 3 2 1 0 +1 +2 +3 3 2 1 0 +1 +2 +3 3 2 1 0 +1 +2 +3 12

Histogram Analysis Graph displays of basic statistical class descriptions Frequency histograms A univariate graphical method Consists of a set of rectangles that reflect the counts or frequencies of the classes present in the given data August 24, 2012 Data Mining: Concepts and Techniques 13

Scatter plot Provides a first look at bivariate data to see clusters of points, outliers, etc Each pair of values is treated as a pair of coordinates and plotted as points in the plane August 24, 2012 Data Mining: Concepts and Techniques 14

Data preprocessing 15

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 Data cleaning tasks Fill in missing values Identify outliers and smooth out noisy data Correct inconsistent data Resolve redundancy caused by data integration 16

Missing Data 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 equipment malfunction 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 not register history or changes of the data Missing data may need to be inferred. 17

How to Handle Missing Data? 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 18

Noisy Data 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 19

How to Handle Noisy Data? 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) 20

Simple Discretization Methods: Binning 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 21

Binning Methods for Data Smoothing 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 22

Data Integration 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 23

Handling Redundancy in Data Integration 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 24

Data Transformation 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 25

Data Reduction Strategies 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 26

Discretization Three types of attributes: Nominal values from an unordered set, e.g., color, profession Ordinal values from an ordered set, e.g., military or academic rank Continuous real numbers, e.g., integer or real numbers Discretization: Divide the range of a continuous attribute into intervals Some classification algorithms only accept categorical attributes. Reduce data size by discretization Prepare for further analysis 27

Discretization and Concept Hierarchy Discretization Reduce the number of values for a given continuous attribute by dividing the range of the attribute into intervals Interval labels can then be used to replace actual data values Supervised vs. unsupervised Split (top-down) vs. merge (bottom-up) Discretization can be performed recursively on an attribute Concept hierarchy formation Recursively reduce the data by collecting and replacing low level concepts (such as numeric values for age) by higher level concepts (such as young, middle-aged, or senior) 28