来源信息
- 仓库
- brycewang-stanford/Auto-Empirical-Research-Skills
- 最近来源活动
- 2026年4月3日 02:07
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 3,291
- 分支
- 432
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
菜单
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills --skill data-anomaly-detection命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
中英双语学术降 AIGC / bilingual academic de-AIGC skill. Removes AI-generated writing signatures from empirical papers in economics, management, and the social sciences — in both English and Chinese. Covers Turnitin AI, GPTZero, Originality.ai on the English side and 知网 AMLC, 万方, 维普 on the Chinese side. Uses a six-step loop (intake → audit → claim-evidence check → differentiated rewrite → five-dimension self-score → cold-reader recheck) with two pattern libraries (22 English + 17 Chinese patterns), section-by-section strategies for empirical papers, and hard protections that keep every number, coefficient, and citation intact.
Use when a research task needs reproducible Kaggle discovery, metadata inspection, bounded public-data downloads, competition or kernel discovery, model discovery, or an explicitly approved Kaggle write/delete operation through the official CLI.
基于 SOC 职业分类
正在显示 SKILL.md
| name | data-anomaly-detection |
| description | Detect anomalies and outliers in research data using statistical methods |
| metadata | {"openclaw":{"emoji":"🔎","category":"analysis","subcategory":"statistics","keywords":["anomaly detection","outlier detection","data quality","statistical testing","robust statistics"],"source":"wentor-research-plugins"}} |
A skill for identifying anomalies, outliers, and suspicious patterns in research datasets. Combines classical statistical methods with modern machine learning approaches to flag data points that deviate significantly from expected distributions, helping researchers maintain data integrity and uncover genuine scientific findings.
Anomalous data points in research datasets can arise from measurement errors, instrument malfunction, data entry mistakes, or genuine rare phenomena. Distinguishing between these sources is critical: blindly removing outliers can bias results, while ignoring measurement errors introduces noise. This skill provides a structured framework for detecting, classifying, and handling anomalies in univariate, multivariate, and time-series research data.
The approach follows a three-stage pipeline: detection (flagging candidate anomalies), diagnosis (determining likely cause), and decision (remove, transform, or retain with justification). Every decision is logged for reproducibility and transparent reporting.
import numpy as np
from scipy import stats
def detect_univariate_outliers(data: np.ndarray, method: str = 'iqr') -> dict:
"""
Detect outliers using classical univariate methods.
Methods:
'iqr': Interquartile range (1.5x IQR rule)
'zscore': Z-score threshold (|z| > 3)
'mad': Median absolute deviation (robust)
'grubbs': Grubbs' test for single outlier
"""
results = {'method': method, 'n_total': len(data)}
if method == 'iqr':
q1, q3 = np.percentile(data, [25, 75])
iqr = q3 - q1
lower, upper = q1 - 1.5 * iqr, q3 + 1.5 * iqr
mask = (data < lower) | (data > upper)
elif method == 'zscore':
z = np.abs(stats.zscore(data))
mask = z > 3
elif method == 'mad':
median = np.median(data)
mad = np.median(np.abs(data - median))
modified_z = 0.6745 * (data - median) / mad if mad > 0 else np.zeros_like(data)
mask = np.abs(modified_z) > 3.5
elif method == 'grubbs':
# Grubbs' test for the single most extreme value
n = len(data)
mean, sd = np.mean(data), np.std(data, ddof=1)
g = np.max(np.abs(data - mean)) / sd
t_crit = stats.t.ppf(1 - 0.05 / (2 * n), n - 2)
g_crit = ((n - 1) / np.sqrt(n)) * np.sqrt(t_crit**2 / (n - 2 + t_crit**2))
mask = np.abs(data - mean) / sd >= g_crit
results['outlier_indices'] = np.where(mask)[0].tolist()
results['n_outliers'] = int(mask.sum())
results['pct_outliers'] = round(mask.sum() / len(data) * 100, 2)
return results
from sklearn.covariance import EllipticEnvelope
from sklearn.ensemble import IsolationForest
def detect_multivariate_outliers(X: np.ndarray, method: str = 'mahalanobis') -> dict:
"""
Detect multivariate outliers using distance-based and model-based methods.
"""
if method == 'mahalanobis':
detector = EllipticEnvelope(contamination=0.05, random_state=42)
labels = detector.fit_predict(X) # -1 = outlier, 1 = inlier
elif method == 'isolation_forest':
detector = IsolationForest(
n_estimators=100, contamination=0.05, random_state=42
)
labels = detector.fit_predict(X)
outlier_mask = labels == -1
return {
'method': method,
'outlier_indices': np.where(outlier_mask)[0].tolist(),
'n_outliers': int(outlier_mask.sum()),
'contamination_assumed': 0.05
}
Once candidate anomalies are flagged, classify each by likely cause:
| Category | Indicators | Action |
|---|---|---|
| Measurement error | Value physically impossible, instrument log shows malfunction | Remove with documentation |
| Data entry error | Obvious typo (e.g., extra digit), inconsistent units | Correct if source available, else remove |
| Sampling artifact | Unusual but plausible value from edge of population | Retain; use robust methods |
| Genuine extreme | Verified measurement, consistent with other variables | Retain; report sensitivity analysis |
| Contamination | Data from wrong population or experimental condition | Remove with justification |
def detect_timeseries_anomalies(series: np.ndarray, window: int = 20) -> dict:
"""
Detect anomalies in time-series data using rolling statistics.
"""
rolling_mean = pd.Series(series).rolling(window=window).mean()
rolling_std = pd.Series(series).rolling(window=window).std()
upper_bound = rolling_mean + 3 * rolling_std
lower_bound = rolling_mean - 3 * rolling_std
anomalies = (series > upper_bound) | (series < lower_bound)
return {
'anomaly_indices': np.where(anomalies)[0].tolist(),
'n_anomalies': int(anomalies.sum()),
'window_size': window
}
When reporting anomaly handling in publications: