Data Warehousing and Data Mining · Unit 2
Data Preprocessing and Preparation
Exam-focused notes for Data Preprocessing and Preparation (Data Warehousing and Data Mining, BIT454): what the TU syllabus asks and how it has actually been tested, with 1 solved past questions from this unit.
Data Preprocessing and Preparation in short
Real data is often dirty, incomplete and spread over many sources. Data preprocessing prepares it before mining, because poor data gives poor results.
What this unit covers
- Need for data preprocessing
- Data cleaning and transformation methods
- Data integration and consolidation
- Data reduction techniques
- Handling missing values and noise
Need for data preprocessing
2081 · 5 marks
Why is data preprocessing required? Explain any two data preprocessing methods. [5]
Show solved answerHide answer
Model Answer: Data Preprocessing
Why Data Preprocessing is Required (2 marks)
Data preprocessing is essential because:
-
Raw data quality issues: Real-world data contains inconsistencies, missing values, duplicates, and noise that can negatively impact model performance and accuracy.
-
Improved model performance: Cleaning and transforming data into a suitable format ensures that machine learning algorithms can learn patterns more effectively and make better predictions.
-
Handling incompatibilities: Raw data may be in different formats, scales, or units. Preprocessing standardizes this to make it compatible with algorithms.
-
Reduced computational cost: Removing irrelevant features and handling outliers reduces the data size and computational burden.
-
Better insights: Preprocessed data reveals meaningful patterns and relationships that would otherwise be obscured by noise and errors.
Two Data Preprocessing Methods (3 marks)
1. Data Cleaning
Data cleaning involves identifying and correcting errors and inconsistencies in the dataset:
- Handling missing values: Replace or remove records with missing data using techniques like mean imputation, forward fill, or deletion.
- Removing duplicates: Identify and eliminate duplicate records that may skew analysis.
- Correcting errors: Fix typos, inconsistent formatting, and logical errors (e.g., negative ages).
- Handling outliers: Detect and manage extreme values that don't fit the normal distribution.
Example: In a student dataset, if some age values are missing, we can fill them with the mean age of the dataset.
2. Data Normalization/Standardization
This method scales numerical features to a common range:
-
Normalization: Scales data to a range [0, 1] using the formula: $$X_{normalized} = \frac{X - X_{min}}{X_{max} - X_{min}}$$
-
Standardization: Transforms data to have mean 0 and standard deviation 1: $$X_{standardized} = \frac{X - \mu}{\sigma}$$
Purpose: Ensures that features with different scales (e.g., age in years vs. income in thousands) contribute equally to model training.
Example: If age ranges 18-80 and salary ranges 20,000-500,000, normalization brings both to [0, 1] scale for fair comparison.
Make Unit 2 stick
Practice BIT454 with flashcards & quizzes