Skip to content
cccskills
FreePublished on GitHub

statistical_outlier_detector

统计与机器学习异常值检测工具。读取结构化表格数据,使用 IQR、Z-score、IsolationForest 或分组标准差一致性方法识别异常值,输出带异常标记、删除异常行或裁剪异常值后的结果文件。

当用户提到异常值检测、离群值识别、IQR、Z-score、IsolationForest、按实验组/分类组检查数值一致性等需求时使用此skill。即使用户没有明确说出“statistical_outlier_detector”,只要任务涉及结构化数值字段异常识别或分组均值标准差一致性检查,就应该使用此skill。

不负责字段固定阈值上下限校验、枚举值校验、时间序列缺失/频率校验或格式转换。

The English summary is being prepared. Showing the original description.

Works withExcel
See how to install

Files included (4)

  • SKILL.md5.4 KB
  • scripts/example_input.json126 B
  • scripts/run_statistical_outlier_detector.py14.6 KB
  • skill.json2.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Statistical Outlier Detector 统计与机器学习异常值检测 Skill

功能概述

本skill用于结构化表格数据的离群值检验,支持统计阈值、机器学习和分组一致性三类方法。 它既能识别全局分布中的异常值,也能识别按分组字段计算后的组内偏离点。 它适合实验对比数据、分类统计数据、传感器数值表等需要数值一致性检查的场景。 它不负责固定业务上下限校验、枚举词典校验或时间序列完整性校验。

触发条件

当用户请求以下任务时,应使用此skill:

  • 异常值检测 / 离群值检测
  • IQR / Z-score / 四分位距 / 标准差阈值识别
  • Isolation Forest / 孤立森林异常识别
  • 按实验组、分类组、批次组检查数值一致性
  • 组内均值偏离超过标准差倍数的异常标记

核心参数说明

必需参数

  • --input:输入文件路径
  • --output:输出文件路径

可选参数

  • --columns:要检测的数值字段,逗号分隔;留空时自动使用所有数值字段
  • --method:检测方法,默认 iqr
  • --threshold:IQR倍数或标准差倍数,默认 1.5
  • --contamination:IsolationForest异常比例,默认 0.05
  • --group_columns:分组字段,group_zscore 方法必填
  • --action:处理方式,默认 mark

输入文件格式

支持 CSV、TSV、Excel(.xls / .xlsx)、JSON、JSONL。 columns 中指定的字段会先转换为数值列后再进行检测;无法转换为数值的值会被视为缺失。 group_columns 仅在分组一致性模式下使用,分组字段本身不参与数值检测。

使用方法

IQR方法检测

python scripts/run_statistical_outlier_detector.py \
  --input data.csv \
  --output result.csv \
  --columns "value,score" \
  --method iqr \
  --threshold 1.5 \
  --action mark

Z-score方法检测

python scripts/run_statistical_outlier_detector.py \
  --input data.csv \
  --output result.csv \
  --columns "value" \
  --method zscore \
  --threshold 3.0 \
  --action remove

IsolationForest方法检测

python scripts/run_statistical_outlier_detector.py \
  --input data.csv \
  --output result.csv \
  --columns "value,score" \
  --method isolation_forest \
  --contamination 0.1 \
  --action mark

分组一致性检测

python scripts/run_statistical_outlier_detector.py \
  --input data.csv \
  --output result.csv \
  --columns "value" \
  --group_columns "experiment,treatment" \
  --method group_zscore \
  --threshold 2.0 \
  --action mark

输出示例

[OK] Outlier detection completed!
   Input file: data.csv
   Output file: result.csv
   Columns: value, score
   Method: group_zscore
   Threshold: 2.0
   Group columns: experiment, treatment
   Action: mark
   Total rows: 1000
   Total outlier rows: 62

环境要求

pip install pandas scipy scikit-learn

注意事项

  1. iqr、zscore、group_zscore 支持 mark、remove、clip,isolation_forest 仅支持 mark 和 remove。
  2. group_zscore 需要提供 group_columns,否则无法计算组内均值和标准差。
  3. columns 为空时会自动选择所有数值列,但仍会忽略无法转为数值的字段。
  4. mark 模式会新增 is_outlier 和字段级异常标记列;remove 模式会删除异常行;clip 模式会截断异常数值。
  5. 这是统一的离群检验 skill,不再拆分为独立的机器学习异常行检测 skill。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

领域缩略语展开 Skill:按内置或外部词典将独立缩略语替换为全称,可选在全称后保留原缩写。 适用于技术文本、论文摘要和业务记录中的缩写清洗;不负责模糊缩写消歧或大小写无关替换。

The English summary is being prepared. Showing the original description.

cas-bigdatalab/piflow541Updated Oct 17, 2026

字母数字比例过滤器。过滤文本中字母/数字比例不在指定范围内的样本。 当用户提到文本过滤、比例筛选、字母比例、数字比例、清理乱码文本等需求时使用此skill。 即使用户没有明确说出"过滤",只要任务涉及根据文本中字母或数字的比例来筛选数据, 就应该使用此skill。

The English summary is being prepared. Showing the original description.

cas-bigdatalab/piflow541Updated Oct 17, 2026

平均行长度过滤器。过滤文本平均行长度不在指定范围内的样本。 当用户提到行长度过滤、平均行长度、文本行长度筛选、按行筛选等需求时使用此skill。 即使用户没有明确说出"平均行长度",只要任务涉及根据文本中每行的平均长度来筛选数据, 就应该使用此skill。

The English summary is being prepared. Showing the original description.

cas-bigdatalab/piflow541Updated Oct 17, 2026

批量文件清单采集器。扫描一个或多个本地文件/目录,或从任务列表加载路径, 按支持的扩展名生成文件元信息清单,供后续文本、表格、文档、图像等采集流程继续处理。 当用户需要批量盘点待采集文件、生成本地文件 manifest、统计输入文件类型或为后续采集算子准备文件清单时使用此 skill。

The English summary is being prepared. Showing the original description.

cas-bigdatalab/piflow541Updated Oct 17, 2026

批量数据均匀分片工具。读取json/jsonl/csv输入,按份数或固定条数切成多个子文件,输出一个清单JSON供下游节点消费。 当用户提到数据分割、批量拆分、数据分片、均匀分块等需求时使用此skill。 即使用户没有明确说出"分片",只要任务是把整份批量数据均匀拆成多个文件,就应该使用此skill。 不负责按字段分组导出或随机采样。

The English summary is being prepared. Showing the original description.

cas-bigdatalab/piflow541Updated Oct 17, 2026

本skill是用于单细胞测序数据分析的专用技能,首先需要用户上传需要处理的单细胞测序数据,再对经过预处理的单细胞表达数据进行自动化细胞类型注释。它通过基因比对、数据标准化、降维等一系列流程,将细胞聚类结果与已知参考数据库进行匹配,从而为每个细胞分配生物学功能标签。

The English summary is being prepared. Showing the original description.

cas-bigdatalab/piflow541Updated Oct 17, 2026

See all skills by cas-bigdatalab

Report a problem with this skill