Files
Clayton Young df58339850 feat(timesfm): complete all three examples with quality docs
- anomaly-detection: full two-phase rewrite (context Z-score + forecast PI),
  2-panel viz, Sep 2023 correctly flagged CRITICAL (z=+3.03)
- covariates-forecasting: v3 rewrite with variable-shadowing bug fixed,
  2x2 shared-axis viz showing actionable covariate decomposition,
  108-row CSV with distinct per-store price arrays
- global-temperature: output/ subfolder reorganization (all 6 output files
  moved, 5 scripts + shell script paths updated)
- SKILL.md: added Examples table, Quality Checklist, Common Mistakes (8 items),
  Validation & Verification with regression assertions
- .gitattributes already at repo root covering all binary types
2026-02-23 07:43:04 -05:00

54 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# run_example.sh - Run the TimesFM temperature anomaly forecasting example
#
# This script:
# 1. Runs the preflight system check
# 2. Runs the TimesFM forecast
# 3. Generates the visualization
#
# Usage:
# ./run_example.sh
#
# Prerequisites:
# - Python 3.10+
# - timesfm[torch] installed: uv pip install "timesfm[torch]"
# - matplotlib, pandas, numpy
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILL_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
echo "============================================================"
echo " TimesFM Example: Global Temperature Anomaly Forecast"
echo "============================================================"
# Step 1: Preflight check
echo ""
echo "🔍 Step 1: Running preflight system check..."
python3 "$SKILL_ROOT/scripts/check_system.py" || {
echo "❌ Preflight check failed. Please fix the issues above before continuing."
exit 1
}
# Step 2: Run forecast
echo ""
echo "📊 Step 2: Running TimesFM forecast..."
cd "$SCRIPT_DIR"
python3 run_forecast.py
# Step 3: Generate visualization
echo ""
echo "📈 Step 3: Generating visualization..."
python3 visualize_forecast.py
echo ""
echo "============================================================"
echo " ✅ Example complete!"
echo "============================================================"
echo ""
echo "Output files:"
echo " - $SCRIPT_DIR/output/forecast_output.csv"
echo " - $SCRIPT_DIR/output/forecast_output.json"
echo " - $SCRIPT_DIR/output/forecast_visualization.png"