[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XDX1NHZF73WJ28BEM97HKB":3,"skill-same:01M6XDX1NHZF73WJ28BEM97HKB":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":13,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6XDX1NHZF73WJ28BEM97HKB","time_series_anomaly_detection",null,"Detect anomalies in time series data using Prophet Framework (Meta), which frames the seasonality, trend holiday effect and other needed regressors into its model, to identify unusual surges or slumps in trends. This is a general methodology analyst can use for understanding what changes of their tracking metrics are manifesting anomalies pattern.","Waaaalnut\u002Fskillsbench","Waaaalnut","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F103995656?v=4","01M6XCS9K1V51EY3JMB7DGMX24","01M6XCS9Q4WPW88W62C55G1H44",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks-no-skills\u002Ftrend-anomaly-causal-inference\u002Fenvironment\u002Fskills\u002Ftime_series_anomaly_detection\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"series","anomaly","time series anomaly detection","anomaly detection","time series","time","detection","general","use","prophet","trend","effect","model","trends","detect","which","can","for","changes","Meta","2026-11-10 10:12:30",false,"---\nname: time_series_anomaly_detection\ndescription: Detect anomalies in time series data using Prophet Framework (Meta), which frames the seasonality, trend holiday effect and other needed regressors into its model, to identify unusual surges or slumps in trends. This is a general methodology analyst can use for understanding what changes of their tracking metrics are manifesting anomalies pattern.\n---\n\n# Time Series Anomaly Detection Framework\n\nComprehensive time series anomaly detection framework leverages Facebook Prophet's time-sereis trend prediction (counterfactural) in the target window and compare it with the actual data. An anomaly index that measures how much deviate the actual number is from the expected trend (counterfactural) for each of the categories or groups within that period. The anomaly index ranking can be used to identify outerstanding groups\u002Fcategories that manifest unexpected surge and slump with quantitative index ranged -100 to 100.\n\n## Core Components\n\n### TimeSeriesAnomalyDetector\nMain class for anomaly detection with configurable parameters.\n#### Constructor Parameters\n- `min_training_days` (int): Minimum days of the available training data required per category (default: 180). Groups have less than this number of days data would be skipped\n- `confidence_interval` (float): Prophet confidence interval width (default: 0.68 = ±1 std) as the starting point to measure the unexpected deviation\n- `changepoint_prior_scale` (float): Flexibility of trend changes (default: 0.05) However, if dataset is not in a big size, use 0.1\n- `seasonality_prior_scale` (float): Strength of seasonality (default: 10.0)\n\n#### Anomaly Index Calculation (This is CRITICAL and is the key to identify unsual pattern)\n- **Within confidence interval**: Index = 0\n- **Above upper bound**: Index = (actual - upper) \u002F std\n- **Below lower bound**: Index = (actual - lower) \u002F std\n- **Scaled Index**: 100 × tanh(raw_index) → maps to [-100, 100] so after this transformation\n    - Index=1 → ~76 points\n    - index=2 → ~96 points\n    - index=3 → ~99.5 points (approaches ±100)\n\n## Usage\n\n```python\nfrom anomaly_detection import TimeSeriesAnomalyDetector\n\n# Initialize detector\ndetector = TimeSeriesAnomalyDetector(\n    min_training_days=180, # depends on the dataset span (usually 50%+ of the dataset time span could be good threshold)\n    confidence_interval=0.68 # 1 std for a good intepretability visually and statistically\n)\n\n# Run anomaly detection\nresults = detector.detect_anomalies(\n    df=transaction_df,\n    date_col='\u003Ctemporal column>',\n    category_col='\u003Cgrouping column>',  \n    value_col='\u003Cmetric to analyze for anomalies>',\n    cutoff_date='\u003Ctraining and prediction split date, format YYYY-MM-DD>',\n    prediction_end='end of prediction window',\n    agg_func='sum',    # Aggregation: 'sum', 'mean', 'count', or None (e.g if data is not transactional data and value_col value is ready for the modeling)\n)\n\n# Access results\nanomaly_summary = results['anomaly_summary']  # All categories with anomaly indices\n\n# Get top 10 postive anomaly groups\ntop_surge = results['anomaly_summary'].head(10)['\u003Cgrouping column>'].tolist()\n\n# Get top 10 negative anomaly groups (descendingly)\ntop_slump = results['anomaly_summary'].tail(10)['\u003Cgrouping column>'].tolist()\n```\n\n## Input Format\n**Required DataFrame columns:**\n- Date column (e.g., `Order Date`, `Transaction Date`,  `Purchase Date`) - temporal dimension\n- Category column (e.g., `Category`, `Region`) - grouping dimension | Granularity that the method will be applied in loops\n- Value column (e.g., `Price`, `Spend`,`Revenue`, `Quantity`) - metric to detect anomalies in (This is very important as this, directly or indirectly, is the y of the modeling)\n- Optional: Additional columns (e.g., `User ID`)\n\n**Parameters:**\n- `cutoff_date`: Divides training data (before) from prediction period (after)\n- `prediction_end`: End of anomaly detection window\n- `agg_func`: How to aggregate values per category per day\n  - `'sum'`: Sum all values of the target column for each category-date (e.g user-level purchase data)\n  - `'mean'`: Average values  \n  - `'count'`: Count records\n  - `None`: No aggregation (e.g non transactional data)\n\n## Output\n\n`detect_anomalies()` returns a dictionary with 3 keys:\n\n```python\n{\n    'anomaly_summary': pd.DataFrame,         # Summary metrics per category\n    'predictions': Dict[str, pd.DataFrame],  # Prophet forecasts per category  \n    'models': Dict[str, Prophet]             # Trained models per category\n}\n```\n\n### Output `anomaly_summary` Preview\n\n| Column | Type | Description |\n|--------|------|-------------|\n| `{category_col}` | str | Category name (column name matches your input) |\n| `Anomaly_Index` | float | Scaled anomaly score in [-100, 100] |\n| `days_with_data` | int | Days with actual data in prediction window |\n| `avg_daily_anomaly` | float | Average of daily scaled anomalies |\n| `max_daily_anomaly` | float | Maximum daily scaled anomaly |\n| `min_daily_anomaly` | float | Minimum daily scaled anomaly |\n| `total_actual` | float | Sum of actual values in prediction window |\n| `total_predicted` | float | Sum of predicted (yhat) values |\n\n**Sorted by `Anomaly_Index` descending**\n\n### `predictions` Dictionary\n\nKey = category name, Value = DataFrame with columns:\n- `ds`: Date  \n- `yhat`: Prophet prediction\n- `yhat_lower`: Lower confidence bound\n- `yhat_upper`: Upper confidence bound\n\n### `models` Dictionary\n\nKey = category name, Value = Fitted Prophet model object\n\n\n## Key Features\n- Pure anomaly detection without business logic (no hardcoded top N)\n- Automatic daily aggregation by grouping dimension\n- Prophet model training with seasonality (daily, weekly, yearly)\n- Counterfactual prediction for intervention analysis\n- Scaled anomaly index [-100, 100] for interpretability\n\n## Best Practices\n- Ensure sufficient training data (180+ days recommended)\n- Use `cutoff_date` to define pre\u002Fpost intervention periods\n- Use `agg_func=None` if data already at daily category level\n- Apply your own filtering logic on `anomaly_summary` (top N, thresholds, etc.)\n- Chain with DID analysis for causal inference on selected categories\n","# Time Series Anomaly Detection Framework\n\nComprehensive time series anomaly detection framework leverages Facebook Prophet's time-sereis trend prediction (counterfactural) in the target window and compare it with the actual data. An anomaly index that measures how much deviate the actual number is from the expected trend (counterfactural) for each of the categories or groups within that period. The anomaly index ranking can be used to identify outerstanding groups\u002Fcategories that manifest unexpected surge and slump with quantitative index ranged -100 to 100.\n\n## Core Components\n\n### TimeSeriesAnomalyDetector\nMain class for anomaly detection with configurable parameters.\n#### Constructor Parameters\n- `min_training_days` (int): Minimum days of the available training data required per category (default: 180). Groups have less than this number of days data would be skipped\n- `confidence_interval` (float): Prophet confidence interval width (default: 0.68 = ±1 std) as the starting point to measure the unexpected deviation\n- `changepoint_prior_scale` (float): Flexibility of trend changes (default: 0.05) However, if dataset is not in a big size, use 0.1\n- `seasonality_prior_scale` (float): Strength of seasonality (default: 10.0)\n\n#### Anomaly Index Calculation (This is CRITICAL and is the key to identify unsual pattern)\n- **Within confidence interval**: Index = 0\n- **Above upper bound**: Index = (actual - upper) \u002F std\n- **Below lower bound**: Index = (actual - lower) \u002F std\n- **Scaled Index**: 100 × tanh(raw_index) → maps to [-100, 100] so after this transformation\n    - Index=1 → ~76 points\n    - index=2 → ~96 points\n    - index=3 → ~99.5 points (approaches ±100)\n\n## Usage\n\n```python\nfrom anomaly_detection import TimeSeriesAnomalyDetector\n\n# Initialize detector\ndetector = TimeSeriesAnomalyDetector(\n    min_training_days=180, # depends on the dataset span (usually 50%+ of the dataset time span could be good threshold)\n    confidence_interval=0.68 # 1 std for a good intepretability visually and statistically\n)\n\n# Run anomaly detection\nresults = detector.detect_anomalies(\n    df=transaction_df,\n    date_col='\u003Ctemporal column>',\n    category_col='\u003Cgrouping column>',  \n    value_col='\u003Cmetric to analyze for anomalies>',\n    cutoff_date='\u003Ctraining and prediction split date, format YYYY-MM-DD>',\n    prediction_end='end of prediction window',\n    agg_func='sum',    # Aggregation: 'sum', 'mean', 'count', or None (e.g if data is not transactional data and value_col value is ready for the modeling)\n)\n\n# Access results\nanomaly_summary = results['anomaly_summary']  # All categories with anomaly indices\n\n# Get top 10 postive anomaly groups\ntop_surge = results['anomaly_summary'].head(10)['\u003Cgrouping column>'].tolist()\n\n# Get top 10 negative anomaly groups (descendingly)\ntop_slump = results['anomaly_summary'].tail(10)['\u003Cgrouping column>'].tolist()\n```\n\n## Input Format\n**Required DataFrame columns:**\n- Date column (e.g., `Order Date`, `Transaction Date`,  `Purchase Date`) - temporal dimension\n- Category column (e.g., `Category`, `Region`) - grouping dimension | Granularity that the method will be applied in loops\n- Value column (e.g., `Price`, `Spend`,`Revenue`, `Quantity`) - metric to detect anomalies in (This is very important as this, directly or indirectly, is the y of the modeling)\n- Optional: Additional columns (e.g., `User ID`)\n\n**Parameters:**\n- `cutoff_date`: Divides training data (before) from prediction period (after)\n- `prediction_end`: End of anomaly detection window\n- `agg_func`: How to aggregate values per category per day\n  - `'sum'`: Sum all values of the target column for each category-date (e.g user-level purchase data)\n  - `'mean'`: Average values  \n  - `'count'`: Count records\n  - `None`: No aggregation (e.g non transactional data)\n\n## Output\n\n`detect_anomalies()` returns a dictionary with 3 keys:\n\n```python\n{\n    'anomaly_summary': pd.DataFrame,         # Summary metrics per category\n    'predictions': Dict[str, pd.DataFrame],  # Prophet forecasts per category  \n    'models': Dict[str, Prophet]             # Trained models per category\n}\n```\n\n### Output `anomaly_summary` Preview\n\n| Column | Type | Description |\n|--------|------|-------------|\n| `{category_col}` | str | Category name (column name matches your input) |\n| `Anomaly_Index` | float | Scaled anomaly score in [-100, 100] |\n| `days_with_data` | int | Days with actual data in prediction window |\n| `avg_daily_anomaly` | float | Average of daily scaled anomalies |\n| `max_daily_anomaly` | float | Maximum daily scaled anomaly |\n| `min_daily_anomaly` | float | Minimum daily scaled anomaly |\n| `total_actual` | float | Sum of actual values in prediction window |\n| `total_predicted` | float | Sum of predicted (yhat) values |\n\n**Sorted by `Anomaly_Index` descending**\n\n### `predictions` Dictionary\n\nKey = category name, Value = DataFrame with columns:\n- `ds`: Date  \n- `yhat`: Prophet prediction\n- `yhat_lower`: Lower confidence bound\n- `yhat_upper`: Upper confidence bound\n\n### `models` Dictionary\n\nKey = category name, Value = Fitted Prophet model object\n\n\n## Key Features\n- Pure anomaly detection without business logic (no hardcoded top N)\n- Automatic daily aggregation by grouping dimension\n- Prophet model training with seasonality (daily, weekly, yearly)\n- Counterfactual prediction for intervention analysis\n- Scaled anomaly index [-100, 100] for interpretability\n\n## Best Practices\n- Ensure sufficient training data (180+ days recommended)\n- Use `cutoff_date` to define pre\u002Fpost intervention periods\n- Use `agg_func=None` if data already at daily category level\n- Apply your own filtering logic on `anomaly_summary` (top N, thresholds, etc.)\n- Chain with DID analysis for causal inference on selected categories\n",{"name":5,"description":7},"main","7eeb258ada72b7f58119b0e7a2c00ea89d9beedd","tasks-no-skills\u002Ftrend-anomaly-causal-inference\u002Fenvironment\u002Fskills\u002Ftime_series_anomaly_detection","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench","https:\u002F\u002Fgithub.com\u002FWaaaalnut","student of Zhejiang University","2026-04-21 23:16:23",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add Waaaalnut\u002Fskillsbench --skill time_series_anomaly_detection",{"tool":56,"command":57},"bunx","bunx skills add Waaaalnut\u002Fskillsbench --skill time_series_anomaly_detection",{"tool":59,"command":60},"pnpm","pnpm dlx skills add Waaaalnut\u002Fskillsbench --skill time_series_anomaly_detection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks-no-skills\u002Ftrend-anomaly-causal-inference\u002Fenvironment\u002Fskills\u002Ftime_series_anomaly_detection\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fanomaly_detection.py","SCRIPT","脚本",12248,"https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks-no-skills\u002Ftrend-anomaly-causal-inference\u002Fenvironment\u002Fskills\u002Ftime_series_anomaly_detection\u002Fscripts\u002Fanomaly_detection.py",[71,85,99,126,146,163],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":81,"publishedAt":38},"01M6XEWMJ6VY3ZC53MPDCPG3GH","data-reconciliation","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fxlsx-recover-data\u002Fenvironment\u002Fskills\u002Fdata-reconciliation\u002FSKILL.md",[76],{"categoryNo":77,"categoryName":78,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[82,83,84],"data reconciliation","reconciliation","data",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":38},"01M6XEW8MNPMF1KRXV6ATGFRQF","speech-to-text","Transcribe video to timestamped text using Whisper tiny model (pre-installed).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-tutorial-indexer\u002Fenvironment\u002Fskills\u002Fspeech-to-text\u002FSKILL.md",[],[92,93,94,95,96,30,97,98],"speech","text","speech to text","transcribe video","whisper","Video","transcribe",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":110,"publishedAt":38},"01M6XEW3FQZP0T1RKQQJFXVY9T","video-processor","Process videos by removing segments and concatenating remaining parts. Use when you need to remove detected pauses\u002Fopenings from videos, create highlight reels, or batch process segment removals using ffmpeg filter_complex.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fvideo-processor\u002FSKILL.md",[105],{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[97,111,112,113,114,115,116,117,118,119,120,121,122,123,124,26,125],"processor","video processor","batch","create","reels","when","parts","segments","process","videos","you","segment","filter","ffmpeg","remove",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":133,"publishedAt":38},"01M6XEVXJ5KZ0NTY3XZKRY4AS1","silence-detector","Detect initial silence segments in audio\u002Fvideo using energy-based analysis. Use when you need to find low-energy periods at the start of recordings (title slides, setup time, pre-roll silence).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsilence-detector\u002FSKILL.md",[132],{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},[134,135,136,137,116,121,23,138,139,140,32,118,141,142,97,143,144,145,26],"detector","silence detector","title","slides","energy","at","recordings","find","Audio","analysis","start","setup",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":38},"01M6XEVT3NGRN1FT7JPMAPXS6M","segment-combiner","Combine multiple segment detection results into a unified list. Use when you need to merge segments from different detectors, prepare removal lists for video processing, or consolidate detection outputs.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsegment-combiner\u002FSKILL.md",[],[122,153,97,24,154,155,156,35,116,157,158,118,121,159,160,26,161,162],"segment combiner","prepare","merge","video processing","outputs","combine","processing","consolidate","results","list",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":172,"publishedAt":38},"01M6XEVMPVASGS2KX86QK4FMT7","report-generator","Generate compression reports for video processing. Use when you need to create structured JSON reports with duration statistics, compression ratios, and segment details after video processing.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Freport-generator\u002FSKILL.md",[169],{"categoryNo":170,"categoryName":171,"taxonomyType":79,"taxonomyTypeDesc":80},"01JBSEEDCAT000000000000034","行政与办公人员",[173,174,175,122,116,35,121,176,159,177,178,179,26,156,180,97,181,182,114],"generator","report generator","report","with","statistics","structured","reports","json","compression","generate"]