Individual skill

evo-trend-anomaly-causal-inference

Complete pipeline for identifying anomalous product category spending patterns in e-commerce data using Prophet counterfactual forecasting, and explaining anomalies through demographic factors via Difference-in-Differences causal inference.

tasks-evolved/trend-anomaly-causal-inference/environment/skills/evo-trend-anomaly-causal-inference/SKILL.md

Read pinned source

Source commit 84ca182da055fafb6453dcec4a6defdbbfd987c1

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Local scripts
Last checked
Nov 6, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
97
Repository last updated
Sep 10, 2026
License
Apache-2.0

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Evo Trend Anomaly Causal Inference

Complete pipeline for identifying anomalous product category spending patterns and using DiD causal inference to explain anomalies through demographic factors.

## Pipeline Steps

1. **Data Cleaning** (`scripts/clean_data.py`): Clean survey and purchase data, handling duplicates, missing values, inconsistent formatting, date parsing, monetary columns, and category extraction.
2. **Anomaly Detection** (`scripts/anomaly_detection.py`): Prophet-based counterfactual forecasting to compute deviation index (-100 to 100) per category for March 2020.
3. **Feature Engineering** (`scripts/feature_engineering.py`): One-hot/ordinal encode demographics, bin continuous variables, produce feature-engineered survey CSV.
4. **DiD Analysis** (`scripts/did_analysis.py`): Difference-in-Differences causal analysis for intensive margin (univariate DiD on spend among purchasers) and extensive margin (multivariate heterogeneous DiD on purchase propensity).

## Usage

```python