3 Data Preprocessing

Data Warehousing and Data Mining · Unit 3 · 3 hrs

Data Preprocessing

Exam-focused notes for Data Preprocessing (Data Warehousing and Data Mining, CSC420): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

Data Preprocessing in short

Raw data collected from the real world is rarely fit to mine directly: it can be incomplete, noisy or inconsistent, and the quality of any mining result is bounded by the quality of the data that goes into it. This unit works through the five standard families of technique used to prepare data before mining: cleaning, integration and transformation, reduction, discretization, and the primitives used to specify a mining task.

Data Preprocessing: notes

Data cleaning

Data cleaning attempts to fill in missing values, smooth out noisy values, and correct inconsistencies in real world data that tends to arrive incomplete, noisy and inconsistent.

Missing values can be handled in several ways. Ignoring the tuple is usually done only when the class label itself is missing, and is not very effective unless a tuple is missing values across several attributes. Filling the value manually is accurate but time consuming and rarely feasible on a large data set. Using a global constant such as "unknown" is simple but can mislead a mining algorithm into treating "unknown" as a real category. Using the attribute mean substitutes the average value of the attribute for the missing entries. Using the most probable value estimates the missing entry with a method such as regression, a Bayesian formalism, or decision tree induction, using the other attributes as predictors.

Noisy data is smoothed with different techniques. Binning methods sort the attribute's values and distribute them into a number of buckets, or bins, smoothing each bin by its mean, its median, or by its boundary values. Outlier analysis uses clustering to group similar data together, then treats objects that fall outside every cluster as outliers to be removed or corrected. Regression fits a function, linear or non-linear, through the data, and that fitted function is then used to smooth the values.

What this unit covers

  • Data cleaning
  • Data integration and transformation
  • Data reduction
  • Data discretization and Concept Hierarchy Generation
  • Data mining primitives

Data cleaning

2081 · 5 marks

Describe any two methods of handling noisy data. [5]

Noisy data refers to data that contains errors, outliers, or random variance that deviates from the expected values. Real world data tends to be incomplete, noisy, and inconsistent. Data cleaning attempts to smooth out noise and correct inconsistencies in the data. --- Binning is a method that sm...

Open this answer on its own page →

2080 · 5 marks

Discuss different ways of smoothing noisy data along with suitable examples. [5]

--- Noisy data refers to data that contains errors, outliers, or random variance that can mislead data mining algorithms. Smoothing is the process of removing such noise to reveal underlying patterns. --- Binning smooths data by sorting values and partitioning them into bins (buckets), then repla...

Open this answer on its own page →

Data integration and transformation

2079 · 5 marks

Why data normalization is important in data mining? Explain min-max and Z-score normalization approach. [5]

Data normalization is important in data mining for the following reasons: - Equal weight to all attributes: Without normalization, attributes with larger ranges (e.g., income: 10,000-100,000) can dominate attributes with smaller ranges (e.g., age: 1-100), biasing the mining results. - Avoids unit...

Open this answer on its own page →

Data discretization and Concept Hierarchy Generation

2078 · 5 marks

Define data discretization. Describe the tasks for data preprocessing. [5]

Show solved answer

Data Discretization and Data Preprocessing Tasks


Part 1: Data Discretization (Definition)

Data discretization is a technique of data preprocessing that transforms continuous (numeric) data into discrete intervals or categories. Instead of working with raw continuous values, the data is divided into a finite number of intervals or bins, and each interval is assigned a label or concept.

For example, a continuous attribute like age (values: 1 to 100) can be discretized into categories such as:

  • Young: 1-30
  • Middle-aged: 31-60
  • Senior: 61-100

Discretization reduces the number of distinct values for a continuous attribute, making data easier to handle in mining tasks like classification and association analysis.


Part 2: Tasks for Data Preprocessing

Raw data collected from the environment can be dirty - meaning it is incomplete, noisy, or inconsistent. Poor quality data leads to poor quality mining results. Therefore, data preprocessing is a critical step in data mining.

The main tasks (categories) of data preprocessing are:


1. Data Cleaning

  • The process of removing noise and inconsistent data from the dataset.
  • Handles missing values, smooths noisy data, identifies or removes outliers, and resolves inconsistencies.
  • Example: Filling in missing age values with the mean age of the dataset.

2. Data Integration

  • The process of combining data from multiple sources (databases, files, data cubes) into a coherent data store.
  • Handles issues like redundancy, duplicate records, and conflicting attribute names.
  • Example: Merging customer data from two different databases into one unified dataset.

3. Data Transformation

  • Data is transformed into forms appropriate for mining.
  • Includes operations such as:
    • Normalization: Scaling values to a small range (e.g., 0.0 to 1.0)
    • Aggregation: Summarizing data
    • Generalization: Replacing low-level data with higher-level concepts
  • Example: Normalizing salary values so they fall between 0 and 1.

4. Data Reduction

  • The process of reducing the volume of data while maintaining analytical integrity.
  • Produces a reduced representation of the dataset that is much smaller in size yet produces the same (or nearly the same) analytical results.
  • Techniques include: dimensionality reduction, numerosity reduction, and data compression.
  • Example: Removing irrelevant attributes that do not contribute to the mining task.

5. Data Discretization

  • Transforms continuous attributes into discrete intervals or categories as defined above.
  • Reduces the number of distinct values for continuous attributes.
  • Particularly useful for algorithms that require categorical data.
  • Example: Converting income (continuous) into Low, Medium, High categories.

Summary Table

TaskPurpose
Data CleaningRemove noise and inconsistencies
Data IntegrationCombine multiple data sources
Data TransformationConvert data into suitable forms
Data ReductionReduce data volume while preserving quality
Data DiscretizationConvert continuous data into discrete intervals

Note: Data preprocessing is one of the most critical steps in data mining because the quality of data directly affects the quality of the mining results.

Open this answer on its own page →

Data mining primitives

2075 · 5 marks

Explain the primitives of data mining query language. [5]

A data mining query is used to specify a data mining task and is input to the data mining system. It is defined in terms of data mining primitives, which allow the user to interactively communicate with the data mining system in order to direct the mining process. --- This primitive specifies the...

Open this answer on its own page →