Data Warehousing and Data Mining: Data Preprocessing and Association Rule Mining
Data Preprocessing Overview
Real-World Data Imperfections:
Incomplete: Lacking specific attribute values, lacking attributes of interest, or containing only aggregate data.
Noisy: Containing errors or outliers.
Inconsistent: Containing discrepancies in naming conventions or coding systems.
Core Preprocessing Tasks:
Data Cleaning: Filling in missing values, smoothing noisy data, identifying and removing outliers, and resolving inconsistencies.
Data Integration: Merging data from heterogeneous repositories (databases, data cubes, or flat files).
Data Transformation: Normalization, data aggregation, and generalization.
Data Reduction: Compacting dataset volume while delivering identical or highly similar analytical results.
Data Discretization: Transforming continuous numerical attributes into categorical/nominal intervals.

Data Cleaning
Methods for Handling Missing Values:
Ignore the tuple: Typically used when the target class label is missing in classification tasks; ineffective when the missingness percentage fluctuates widely across attributes.
Fill in manually: Accurate but prohibitively time-consuming for large datasets.
Use a global constant: Substituting missing cells with a constant label like "Unknown" or .
Use the attribute mean: Substituting with the overall mean of the attribute for all known tuples.
Use the attribute mean for the same class: Substituting with the attribute mean of tuples sharing the same class label.
Use the most probable value: Estimating the missing entry through regression, Bayesian inference, or decision tree induction.
Techniques for Smoothing Noisy Data:
Binning (Local Smoothing): Distributes sorted values into bins and smooths by:
Bin means: Replaces each bin element with the mean of the bin.
Bin medians: Replaces each bin element with the median of the bin.
Bin boundaries: Replaces each bin element with the closest minimum or maximum boundary value of the bin.
Regression: Fits attributes to parametric mathematical equations (simple linear regression or multiple linear regression).
Clustering: Groups similar data points together; values falling outside designated clusters are flagged as outliers.
Data Integration
Primary Integration Challenges:
Entity Identification Problem: Matching equivalent real-world entities across disparate sources (e.g., matching customer_id with customer_number).
Data Value Conflicts: Resolving conflicting values caused by divergent scaling, representations, or unit encodings.
Redundancy: Detecting duplicated or derivable attributes through correlation analysis.
Correlation Analysis for Numerical Attributes:
Evaluated using Pearson's product moment coefficient ():
If , attributes and are positively correlated. Note: Correlation does not imply causality.
Correlation Analysis for Categorical Attributes:
Evaluated using the Chi-Square () test over an contingency table:
The expected frequency () is computed as:
Evaluated under degrees of freedom to determine statistical dependence.
Data Transformation
Transformation Strategies:
Smoothing: Removing noise through binning, regression, or clustering.
Aggregation: Computing summarizations across dimensions (e.g., daily sales aggregated into annual totals).
Generalization: Substituting low-level primitive values with higher-level concepts using concept hierarchies (e.g., street to city, age to senior).
Attribute Construction: Deriving and adding new features to aid data mining.
Normalization Methods:
Min-Max Normalization: Scales an original value linearly into :
Z-Score Normalization (Zero-Mean Normalization): Scales values using the attribute mean () and standard deviation ():
Decimal Scaling: Normalizes by shifting decimal points according to the maximum absolute value:
The parameter represents the smallest integer such that .
Data Reduction
Data Cube Aggregation:
Aggregates multi-dimensional data into cuboids; the lowest abstraction level is the base cuboid, and the highest single-cell summary is the apex cuboid.
Attribute Subset Selection (Feature Selection):
Heuristic greedy techniques include stepwise forward selection, stepwise backward elimination, combined forward-backward approaches, and decision tree induction.
Dimensionality Reduction:
Discrete Wavelet Transform (DWT): A linear signal processing method that decomposes vectors into wavelet coefficients; preserves spatial locality better than the Discrete Fourier Transform (DFT). Common families include Haar-2, Daubechies-4, and Daubechies-6.
Principal Components Analysis (PCA / Karhunen-Loeve method): Computes orthonormal unit vectors () that maximize variance, mapping the data into a lower-dimensional coordinate system.

Numerosity Reduction:
Parametric: Mathematical models where only parameters are stored (e.g., linear regression, multiple regression, log-linear models).
Nonparametric: Histograms (equal-width, equal-frequency, V-Optimal, MaxDiff), clustering, and sampling techniques (SRSWOR, SRSWR, cluster sampling, stratified sampling).
Association Rule Mining Fundamentals
Core Definitions:
Frequent Patterns: Itemsets, subsequences, or substructures that occur in a dataset with a frequency above a defined threshold.
Market Basket Analysis: Uncovers buying associations between products co-occurring in transactional baskets.
Interestingness Measures:
Support: Probability that a transaction contains the combined itemset :
Confidence: Conditional certainty that item is present given item is present:
Two-Step Mining Process:
Identify all frequent itemsets that satisfy the minimum support count ().
Extract strong association rules from frequent itemsets that satisfy both and minimum confidence ().
The Apriori Algorithm
Foundation: Proposed by R. Agrawal and R. Srikant (1994) for discovering Boolean association rules using iterative level-wise candidate generation.
The Apriori Property (Antimonotonicity):
All nonempty subsets of a frequent itemset must also be frequent.
If an itemset is infrequent (), then adding any item to produces an infrequent superset ().
Level-Wise Iteration Steps ():
Join Step: Generates candidate itemsets by joining with itself ().
Prune Step: Discards any candidate itemset in that contains an infrequent -subset.
Database Scan: Counts occurrences of remaining candidates in database to form frequent set .
Association Rule Generation
Rule Derivation Pipeline:
For every frequent itemset , compute all nonempty subsets .
Construct association rules of the form .
Keep rules that meet or exceed :
Rules generated from frequent itemsets automatically satisfy the minimum support threshold.
Mining Frequent Itemsets without Candidate Generation (FP-Growth)
FP-Growth Architecture:
Uses a divide-and-conquer strategy to avoid expensive candidate generation and repeated database scans.
Compresses the database into a compact Frequent-Pattern Tree (FP-tree) that retains complete itemset association details.
Tree Construction Process:
Scan 1: Identifies frequent 1-itemsets and sorts them in descending order of support count into list .
Scan 2: Reads transactions sequentially, reorders their items according to , and maps them into tree branches rooted at a "null" node, sharing common prefixes and incrementing node counts.

Mining the FP-Tree:
Traverses frequent items starting from the bottom of list (suffix patterns).
Constructs a conditional pattern base (prefix paths co-occurring with the suffix).
Builds a conditional FP-tree from the conditional pattern base.
Recursively concatenates suffix items with patterns derived from conditional FP-trees to output frequent patterns.