mirror of
https://github.com/K-Dense-AI/claude-scientific-skills.git
synced 2026-03-27 07:09:27 +08:00
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
This commit is contained in:
@@ -24,7 +24,7 @@ MAX_HORIZON = (
|
||||
)
|
||||
TOTAL_MONTHS = 48 # Total months from 2022-01 to 2025-12 (graph extent)
|
||||
INPUT_FILE = Path(__file__).parent / "temperature_anomaly.csv"
|
||||
OUTPUT_FILE = Path(__file__).parent / "animation_data.json"
|
||||
OUTPUT_FILE = Path(__file__).parent / "output" / "animation_data.json"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
||||
@@ -18,8 +18,8 @@ from PIL import Image
|
||||
|
||||
# Configuration
|
||||
EXAMPLE_DIR = Path(__file__).parent
|
||||
DATA_FILE = EXAMPLE_DIR / "animation_data.json"
|
||||
OUTPUT_FILE = EXAMPLE_DIR / "forecast_animation.gif"
|
||||
DATA_FILE = EXAMPLE_DIR / "output" / "animation_data.json"
|
||||
OUTPUT_FILE = EXAMPLE_DIR / "output" / "forecast_animation.gif"
|
||||
DURATION_MS = 500 # Time per frame in milliseconds
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import json
|
||||
from pathlib import Path
|
||||
|
||||
EXAMPLE_DIR = Path(__file__).parent
|
||||
DATA_FILE = EXAMPLE_DIR / "animation_data.json"
|
||||
OUTPUT_FILE = EXAMPLE_DIR / "interactive_forecast.html"
|
||||
DATA_FILE = EXAMPLE_DIR / "output" / "animation_data.json"
|
||||
OUTPUT_FILE = EXAMPLE_DIR / "output" / "interactive_forecast.html"
|
||||
|
||||
|
||||
HTML_TEMPLATE = """<!DOCTYPE html>
|
||||
|
||||
|
Before Width: | Height: | Size: 776 KiB After Width: | Height: | Size: 776 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
@@ -48,6 +48,6 @@ echo " ✅ Example complete!"
|
||||
echo "============================================================"
|
||||
echo ""
|
||||
echo "Output files:"
|
||||
echo " - $SCRIPT_DIR/forecast_output.csv"
|
||||
echo " - $SCRIPT_DIR/forecast_output.json"
|
||||
echo " - $SCRIPT_DIR/forecast_visualization.png"
|
||||
echo " - $SCRIPT_DIR/output/forecast_output.csv"
|
||||
echo " - $SCRIPT_DIR/output/forecast_output.json"
|
||||
echo " - $SCRIPT_DIR/output/forecast_visualization.png"
|
||||
|
||||
@@ -94,7 +94,8 @@ output_df = pd.DataFrame(
|
||||
)
|
||||
|
||||
# Save outputs
|
||||
output_dir = Path(__file__).parent
|
||||
output_dir = Path(__file__).parent / "output"
|
||||
output_dir.mkdir(exist_ok=True)
|
||||
output_df.to_csv(output_dir / "forecast_output.csv", index=False)
|
||||
|
||||
# JSON output for the report
|
||||
|
||||
@@ -23,8 +23,8 @@ import pandas as pd
|
||||
# Configuration
|
||||
EXAMPLE_DIR = Path(__file__).parent
|
||||
INPUT_FILE = EXAMPLE_DIR / "temperature_anomaly.csv"
|
||||
FORECAST_FILE = EXAMPLE_DIR / "forecast_output.json"
|
||||
OUTPUT_FILE = EXAMPLE_DIR / "forecast_visualization.png"
|
||||
FORECAST_FILE = EXAMPLE_DIR / "output" / "forecast_output.json"
|
||||
OUTPUT_FILE = EXAMPLE_DIR / "output" / "forecast_visualization.png"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
||||
Reference in New Issue
Block a user