Examples Gallery¶
21 real-world case studies demonstrating temporalcv’s capabilities across different domains and use cases.
Core Concepts (00-05)¶
Foundational examples introducing validation gates, walk-forward CV, statistical tests, persistence metrics, and conformal prediction.
Production Workflows (06-10)¶
Complete pipelines for real ML systems: financial CV with purging, nested CV for hyperparameter tuning, regime stratification, multi-horizon comparison, and end-to-end deployment.
Domain-Specific (11-15)¶
Industry-tailored examples: web traffic with seasonality, IoT sensors with anomalies, macro GDP forecasting, energy load prediction, and cryptocurrency with regime shifts.
Failure Cases (16-20)¶
Learn from common mistakes: each shows what goes wrong and how the validation gates catch the issue before it corrupts your results.
Note
All examples use synthetic data and require no external datasets.
Run any example with python examples/XX_name.py.
Example 01: Detecting Data Leakage with the Shuffled Target Test
Example 02: Walk-Forward Cross-Validation with Gap Enforcement
Example 03: Statistical Tests for Forecast Comparison
Example 06: Financial Cross-Validation with PurgedKFold
Example 07: Nested Cross-Validation for Hyperparameter Tuning
Example 16: FAILURE CASE — Rolling Statistics on Full Series
Example 18: FAILURE CASE — Using DM Test for Nested Models
Example 19: FAILURE CASE — Missing Gap for Multi-Step Forecasting
Example 20: FAILURE CASE — KFold Instead of WalkForward