Tabular Data

1. Purpose & Motivation

1.1 Why tabular data matters

  • Most enterprise and scientific data is stored in tables (databases, spreadsheets, CSVs)
  • Tabular data is the most common data format in real-world ML applications
  • Understanding its structure is essential for choosing appropriate models and preprocessing

1.2 The core problem it addresses

Organize observations as rows and attributes as columns to enable systematic analysis, modeling, and storage of structured information.

2. Definition & Core Idea

2.1 Formal definition

Tabular data is data organized in a two-dimensional table where each row represents an observation (sample, record) and each column represents a feature (attribute, variable). Each cell contains a single value.

2.2 Intuitive mental model

"A spreadsheet where each row is a patient and each column is a measurement (age, blood pressure, diagnosis) -- the most natural way to organize structured information."

3. Structure

3.1 Anatomy of a table

Component Role Example
Row One observation / sample A single customer
Column One feature / attribute Customer age
Cell Single value at a row-column intersection 34
Index Unique identifier per row Customer ID
Header Column names describing each feature "age", "income"

3.2 Feature types in tabular data

Type Description Examples
Numerical Continuous or discrete numbers Price, count, temperature
Categorical Finite set of discrete labels Color, country, product type
Ordinal Categorical with meaningful order Education level, rating (1-5)
Boolean Binary true/false Is_active, has_subscription
DateTime Temporal values Purchase date, signup timestamp
Text Free-form strings Product description, comments

4. Common Preprocessing Steps

4.1 Handling missing values

  • Imputation (mean, median, mode, or model-based)
  • Dropping rows or columns with excessive missingness
  • Indicator columns flagging that a value was missing

4.2 Encoding and scaling

  • One-hot or target encoding for categorical features
  • Standardization or normalization for numerical features
  • Log transforms for skewed distributions

4.3 Data quality checks

  • Duplicate detection and removal
  • Outlier identification
  • Consistency validation across columns

5. Models That Excel on Tabular Data

Model family Why it works well
Gradient Boosting State-of-the-art; handles mixed types natively
Random Forest Robust, minimal preprocessing required
Linear models Fast, interpretable baseline
Deep learning Competitive but often requires more tuning

Key insight: Tree-based ensemble methods (XGBoost, LightGBM, CatBoost) consistently dominate benchmarks on tabular data.

6. Tabular Data vs Other Data Types

Aspect Tabular Images / Text / Audio
Structure Rows and columns Grid, sequence, waveform
Features Heterogeneous types Homogeneous (pixels, tokens)
Best models Tree ensembles Deep neural networks
Preprocessing Feature engineering Learned representations

7. One-Sentence Summary

Tabular data organizes observations as rows and features as columns, forming the most common data format in real-world machine learning where tree-based models dominate.

8. Related Knowledge Pages