Course contentsShow
← Machine Learning and Deep Learning
Lesson 3360 of 3,53873. Privacy in Machine LearningFree lesson

Vertical and Horizontal Federated Learning

Distinguishing between feature-partitioned and sample-partitioned federated scenarios.

Vertical and Horizontal Federated Learning

What you'll learn: How federated learning scenarios differ based on whether participants share the same features or the same samples.

The Two Federated Paradigms

Until now, we've discussed federated learning as a general privacy-preserving training approach. But not all federated scenarios look the same—they differ fundamentally in how data is partitioned across participants.

Horizontal Federated Learning (Sample-Partitioned)

Horizontal FL occurs when multiple parties have datasets with the same features but different samples. Think of hospitals training a diagnostic model: each hospital has patient records with the same medical measurements (blood pressure, age, test results), but different patients. The feature space overlaps completely; the samples don't.

This is the most common federated scenario and matches what we've described with FedAvg—each client trains on their local samples with the same model architecture, then aggregates updates.

Vertical Federated Learning (Feature-Partitioned)

Vertical FL happens when parties have datasets with overlapping samples but different features. Imagine a bank and an e-commerce platform both serving the same customers: the bank knows credit history, the e-commerce site knows purchase behavior. They share users (samples) but have disjoint feature sets.

Vertical FL is more complex—it requires aligning which samples correspond across parties (often using privacy-preserving record linkage) and training models that combine feature spaces without revealing raw features to each other.

Choosing Your Scenario

The distinction matters for protocol design. Horizontal FL focuses on communication efficiency and handling non-IID distributions. Vertical FL emphasizes secure computation for feature combination and protecting feature-level privacy.

Key Takeaway: Horizontal federated learning partitions data by samples (same features, different users), while vertical federated learning partitions by features (same users, different attributes)—each requires distinct architectural and privacy considerations.