TS Core
Task Recognition
Identify first: forecasting / classification / anomaly detection / event detection / segmentation / imputation / representation learning. Then: univariate/multivariate, one-step/multi-step, point/interval forecast, single/multi-entity.
Write time format clearly: timestamps, timezone, frequency, window, forecast step, entity granularity, exogenous variables. Prevent leakage: split, normalization, feature building, target alignment must follow time boundaries.
Data Contract
Before analysis, unify data entry into one contract: source type, time column, target column, feature columns, entity columns, frequency/timezone, data range, missing-value strategy, split method, output location.
Four entry types: PDF (use pdf-intake read-only), table files (header/type/time-column checks), databases (query contract, reproducible middle table), code-style DataLoader (review I/O contract, check leakage).
If raw directory doesn't fit project structure, copy into data/raw_external/ or equivalent, then normalize. Downstream depends only on the normalized interface.
Visual Analysis (Mandatory)
Plot first, then judge. At minimum:
- Raw time-series line plots, local zoom, entity/variable comparison
- Missing values, outliers, distribution drift, regime shift markers
- Rolling mean/variance, season/trend decomposition when possible
- ACF/PACF, spectrum, periodicity diagnosis when possible
If the figure is wrong (bad axes, hidden lines, missing legends, broken export), fix the figure first.
Statistical / Feature Analysis
Check: length/frequency stability, missing patterns, outlier ratio, stationarity signs, trend/seasonality/noise/heteroscedasticity, lag relations, cross-entity patterns. Use tsfresh-style features to answer: is this trend-driven, cycle-driven, event-driven, or noise-driven?
Method Family & Latest-Method Awareness
Never default to a familiar method without checking what's current. Before implementation:
- Compare
direct use / zero-shot / few-shot / frozen-backbone / light adaptation / retraining — training is NOT the default.
- Consider at least these families in parallel:
- Statistical (ARIMA, ETS, Prophet, state-space)
- Traditional ML (XGBoost, LightGBM, CatBoost with lag features)
- Deep learning (LSTM, TCN, Transformer variants, PatchTST, DLinear)
- Pretraining / TSFM (Chronos, TimesFM, TimeGPT, Moirai, Lag-Llama)
- Hybrid / rule-constrained / tool-enhanced
- Each route must answer: why it fits, what assumptions, when it fails, engineering cost, can it be used directly/zero-shot/light-adapted.
- If a TSFM/foundation route fails on environment/deps/weights, do NOT kill it directly. Judge workarounds: zero-shot, few-shot, frozen-backbone, lighter setup, window changes, two-stage design.
- Use
information-collector to search for latest methods and SOTA before committing to a route. Do not assume the method you know is the best available.
Domain Priors (Brief)
Time-series tasks appear across many domains. Recognize the domain early — it shapes data patterns, constraints, and evaluation:
| Domain |
Typical Patterns |
Key Risks |
Special Needs |
| Energy/Power |
Strong daily/weekly cycles, weather sensitivity, holiday effects |
Concept drift from policy/season changes, sensor faults |
Load forecasting, demand response, renewable integration |
| Finance/Trading |
Long-term trends, volatility clustering, regime switches, fat tails |
Look-ahead bias, survivorship bias, market microstructure noise |
Technical indicators, factor models, event studies, risk metrics (VaR, drawdown) |
| Traffic/Transport |
Rush-hour peaks, weekend/weekday split, incident shocks |
Sensor dropout, network topology effects, weather interaction |
Spatiotemporal GNN, multi-sensor fusion |
| Weather/Climate |
Multi-scale periodicity, spatial correlation, extreme events |
Distribution shift from climate change, measurement drift |
Physical constraints, ensemble methods, downscaling |
| Healthcare/Medical |
Patient-specific baselines, intervention effects, irregular sampling |
Missing not at random (MNAR), privacy constraints, small samples |
Clinical validation, uncertainty quantification, causal inference |
| Retail/Sales |
Holiday spikes, promotion effects, trend + seasonality, new product cold-start |
Promotion confounding, stockout censoring, returns distortion |
Hierarchical forecasting, causal impact, price elasticity |
| Industrial/IoT |
Degradation trends, maintenance events, multi-sensor correlation |
Sensor drift, unlabeled anomalies, concept drift from wear |
Anomaly detection, remaining useful life, predictive maintenance |
| Web/CloudOps |
Bursty traffic, diurnal patterns, deployment-induced shifts |
High cardinality, concept drift from releases, alert fatigue |
Anomaly detection, capacity planning, root-cause analysis |
For any domain: search both general TS methods AND domain-specific mechanisms. Do not treat domain keyword + "time series" as the whole first-round search.
Forecast Validation
Before accepting any forecast output:
- Horizon length — output must match task requirement exactly.
- Output schema — clear schema first, then generate. Label sets enforced for classification/MCQ.
- Numerical plausibility — units/scale match history, no unexplained explosion/drift/negative, volatility reasonable, physical/business constraints respected.
- Uncertainty strategy — when evidence is weak, prefer
Uncertain/intervals/confidence info over hard guessing.
Post-Experiment Analysis
Do NOT look only at the main metric. Required before closeout:
- SHAP / feature attribution or equivalent explanation analysis
- Error distribution, residual diagnosis, failure cases
- Slice/cohort analysis (time range, horizon, entity)
- Statistical tests / significance when applicable
- Math-modeling view: can the error be rewritten as residual modeling, error decomposition, layered/segmented models, state-switch, or constrained optimization?
If any of these is missing, the experiment is not done.
Test Loop
Fixed loop: save structured results → make plots with scripts/plot/ → visual semantic analysis → targeted retest from visual findings → self-critique → ts-critic review again. If one link is missing, the loop is not complete.
Length Awareness
Do not assume more history is always better. Look for the sweet spot: what short/middle/long windows each add, where noise dominates. For long history, consider: salient-subsequence retrieval, regime compression, structured summaries, parallel multi-scale windows.
1---2name: ts-core3description: TS Core4---567# TS Core89## Task Recognition1011Identify first: forecasting / classification / anomaly detection / event detection / segmentation / imputation / representation learning. Then: univariate/multivariate, one-step/multi-step, point/interval forecast, single/multi-entity.1213Write time format clearly: timestamps, timezone, frequency, window, forecast step, entity granularity, exogenous variables. Prevent leakage: split, normalization, feature building, target alignment must follow time boundaries.1415## Data Contract1617Before analysis, unify data entry into one contract: source type, time column, target column, feature columns, entity columns, frequency/timezone, data range, missing-value strategy, split method, output location.1819Four entry types: PDF (use `pdf-intake` read-only), table files (header/type/time-column checks), databases (query contract, reproducible middle table), code-style DataLoader (review I/O contract, check leakage).2021If raw directory doesn't fit project structure, copy into `data/raw_external/` or equivalent, then normalize. Downstream depends only on the normalized interface.2223## Visual Analysis (Mandatory)2425Plot first, then judge. At minimum:26- Raw time-series line plots, local zoom, entity/variable comparison27- Missing values, outliers, distribution drift, regime shift markers28- Rolling mean/variance, season/trend decomposition when possible29- ACF/PACF, spectrum, periodicity diagnosis when possible3031If the figure is wrong (bad axes, hidden lines, missing legends, broken export), fix the figure first.3233## Statistical / Feature Analysis3435Check: length/frequency stability, missing patterns, outlier ratio, stationarity signs, trend/seasonality/noise/heteroscedasticity, lag relations, cross-entity patterns. Use `tsfresh`-style features to answer: is this trend-driven, cycle-driven, event-driven, or noise-driven?3637## Method Family & Latest-Method Awareness3839**Never default to a familiar method without checking what's current.** Before implementation:40411. Compare `direct use / zero-shot / few-shot / frozen-backbone / light adaptation / retraining` — training is NOT the default.422. Consider at least these families in parallel:43 - Statistical (ARIMA, ETS, Prophet, state-space)44 - Traditional ML (XGBoost, LightGBM, CatBoost with lag features)45 - Deep learning (LSTM, TCN, Transformer variants, PatchTST, DLinear)46 - Pretraining / TSFM (Chronos, TimesFM, TimeGPT, Moirai, Lag-Llama)47 - Hybrid / rule-constrained / tool-enhanced483. Each route must answer: why it fits, what assumptions, when it fails, engineering cost, can it be used directly/zero-shot/light-adapted.494. If a TSFM/foundation route fails on environment/deps/weights, do NOT kill it directly. Judge workarounds: zero-shot, few-shot, frozen-backbone, lighter setup, window changes, two-stage design.505. Use `information-collector` to search for latest methods and SOTA before committing to a route. Do not assume the method you know is the best available.5152## Domain Priors (Brief)5354Time-series tasks appear across many domains. Recognize the domain early — it shapes data patterns, constraints, and evaluation:5556| Domain | Typical Patterns | Key Risks | Special Needs |57|--------|-----------------|-----------|---------------|58| **Energy/Power** | Strong daily/weekly cycles, weather sensitivity, holiday effects | Concept drift from policy/season changes, sensor faults | Load forecasting, demand response, renewable integration |59| **Finance/Trading** | Long-term trends, volatility clustering, regime switches, fat tails | Look-ahead bias, survivorship bias, market microstructure noise | Technical indicators, factor models, event studies, risk metrics (VaR, drawdown) |60| **Traffic/Transport** | Rush-hour peaks, weekend/weekday split, incident shocks | Sensor dropout, network topology effects, weather interaction | Spatiotemporal GNN, multi-sensor fusion |61| **Weather/Climate** | Multi-scale periodicity, spatial correlation, extreme events | Distribution shift from climate change, measurement drift | Physical constraints, ensemble methods, downscaling |62| **Healthcare/Medical** | Patient-specific baselines, intervention effects, irregular sampling | Missing not at random (MNAR), privacy constraints, small samples | Clinical validation, uncertainty quantification, causal inference |63| **Retail/Sales** | Holiday spikes, promotion effects, trend + seasonality, new product cold-start | Promotion confounding, stockout censoring, returns distortion | Hierarchical forecasting, causal impact, price elasticity |64| **Industrial/IoT** | Degradation trends, maintenance events, multi-sensor correlation | Sensor drift, unlabeled anomalies, concept drift from wear | Anomaly detection, remaining useful life, predictive maintenance |65| **Web/CloudOps** | Bursty traffic, diurnal patterns, deployment-induced shifts | High cardinality, concept drift from releases, alert fatigue | Anomaly detection, capacity planning, root-cause analysis |6667For any domain: search both general TS methods AND domain-specific mechanisms. Do not treat domain keyword + "time series" as the whole first-round search.6869## Forecast Validation7071Before accepting any forecast output:721. **Horizon length** — output must match task requirement exactly.732. **Output schema** — clear schema first, then generate. Label sets enforced for classification/MCQ.743. **Numerical plausibility** — units/scale match history, no unexplained explosion/drift/negative, volatility reasonable, physical/business constraints respected.754. **Uncertainty strategy** — when evidence is weak, prefer `Uncertain`/intervals/confidence info over hard guessing.7677## Post-Experiment Analysis7879Do NOT look only at the main metric. Required before closeout:80- SHAP / feature attribution or equivalent explanation analysis81- Error distribution, residual diagnosis, failure cases82- Slice/cohort analysis (time range, horizon, entity)83- Statistical tests / significance when applicable84- Math-modeling view: can the error be rewritten as residual modeling, error decomposition, layered/segmented models, state-switch, or constrained optimization?8586If any of these is missing, the experiment is not done.8788## Test Loop8990Fixed loop: save structured results → make plots with `scripts/plot/` → visual semantic analysis → targeted retest from visual findings → self-critique → `ts-critic` review again. If one link is missing, the loop is not complete.9192## Length Awareness9394Do not assume more history is always better. Look for the sweet spot: what short/middle/long windows each add, where noise dominates. For long history, consider: salient-subsequence retrieval, regime compression, structured summaries, parallel multi-scale windows.