outlier_detect
Detect outliers in tabular data via the IQR method. Returns lower/upper bounds and flagged outlier values for numeric columns, skipping non-numeric columns without removing anything.
Instructions
outlier_detect —— 数据探查组 · 异常值检测(工具 5,核心实现)。
docstring = agent 使用说明书,与 statlab_mcp/docs/design/02_data_exploration_batch2.md 同步维护。
参数: file_path (str): 本地数据文件(csv/tsv/xlsx/json),仅接受本地路径 method (str, "iqr"): 仅支持 iqr(规格 4 唯一定义;zscore 场景在时序组 rolling_zscore)
口径: IQR 法:lower = Q1 - 1.5IQR,upper = Q3 + 1.5IQR(分位数 linear 插值,同 describe); 异常值 = 有效值中 <lower 或 >upper 的值;绝不自动剔除,只报告; 数值列有效值 n<4 → IQR 无定义,bounds=null、n_outliers=0;常量列 bounds 相等无异常; 非数值列跳过并列入 skipped_columns;单列异常值超 100 个时截断显示并注明。
图(附录 D): 并列箱线图(异常值红色 scatter);文件名 outlier_detect_all_YYYYmmdd_HHMMSS.png 存 reports/plots/;返回 JSON 顶层附加 image(绝对路径,禁 base64,与 result 平级)。
示例: outlier_detect("samples/dirty.csv") inline 数据: 本工具支持可选 inline_data 参数(v1.2.0 起):与 file_path 二选一, 支持 records 数组或 {"header": [...], "rows": [[...], ...]} 对象两种形态; 规模上限/类型域/data_source 来源标注见 statlab_mcp/docs/SPEC.md 第 12 节。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | iqr | |
| file_path | No | ||
| inline_data | No |