BIT454 ยท 2081 ยท 5 marks
Why is data preprocessing required? Explain any two data preprocessing methods.
Why is data preprocessing required? Explain any two data preprocessing methods. [5]
Quick answer
Data cleaning involves identifying and correcting errors and inconsistencies in the dataset: Handling missing values; Removing duplicates; Correcting errors.
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.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.