neurokit2
它能做什么
这个工具借助 NeuroKit2 库,帮助研究人员以可靠、可重复的方式整理和分析生理信号数据(比如心跳)。它能让处理步骤清晰明了,结果也便于验证。
适用场景
- ✓当你导入或使用 NeuroKit2 库分析生物数据时。
- ✓当你需要确保生理信号分析结果可以复现时。
- ✓当你处理用于研究的生理时间序列数据时。
技能链接
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/neurokit2/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“如何使用 NeuroKit2 对 ECG 数据进行可重复的处理和分析,并确保伪迹得到校正?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具遵循分步流程,对信号进行检查、清理和分析。在应用具体分析方法之前,它会先检查采样率、单位以及可能存在的数据问题等细节。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
NeuroKit2
Scope and evidence cutoff
Use this skill for method-aware, reproducible biosignal research with NeuroKit2. The snapshot was checked on 2026-10-01 against:
- stable PyPI 0.2.13, released 2026-03-02;
- Python metadata (
>=3.10; classifiers 3.10–3.14) and wheel dependencies; - GitHub release notes/tags,
NEWS.rst, source at tagv0.2.13; - official API pages/examples (the live site identified itself as
0.2.13.dev214); and - pinned 0.2.13 runtime signatures and synthetic output schemas.
The current wheel requires pandas<3.0.0. The refreshed core checks use Python 3.13,
NumPy 2.5.3, and pandas 2.3.3; forcing pandas 3 conflicts with upstream metadata.
API fragments below assume caller-provided arrays and imports. Optional MNE source
reconstruction, cvxEDA, EMD, and pyRQA paths are source-reviewed, not runtime-validated
by this refresh. Synthetic checks establish software behavior, not empirical validity.
The live documentation can be ahead of the stable wheel. Prefer the pinned runtime for reproducible work and name both versions if consulting development docs.
Boundary
NeuroKit2 is a research and educational toolbox. Do not present its output as:
- a diagnosis, treatment recommendation, patient-monitoring decision, or alarm;
- validation, certification, or regulatory evidence for a medical device; or
- proof that a physiological construct is measured validly in a new sensor, protocol, environment, population, or disease group.
Validate acquisition hardware, electrode/optode placement, units, sampling and clock accuracy, preprocessing, detector/decomposition method, population, task, and outcomes for the intended study. Preserve raw data and an auditable exclusion log. Use deidentified local files only; do not place PHI in prompts, logs, examples, or bundled fixtures.
Reproducible installation
uv pip install "neurokit2==0.2.13"
For optional features, create a uv project, add only the packages actually required at
reviewed exact versions, and commit/review the resulting uv.lock before
uv sync --locked. NeuroKit2 exposes an upstream full extra, but this skill
intentionally does not install that floating transitive set in an automated workflow.
Optional capabilities can require MNE, cvxopt, Plotly, PyEMD, pyRQA, Pillow, OpenCV,
or file readers. Record the resolved environment with the analysis. Provision any MNE
data/template download as an explicit, checksummed study input. Do not install a moving
development branch for a reproducible study.
Required data contract
Before processing, record:
- signal identity and sensor/channel configuration;
- native sampling rate in Hz and physical unit (or explicitly
arbitrary_unit); - clock, timestamp origin, drift correction, and synchronization evidence;
- polarity/orientation and acquisition-side filters/gain;
- missing samples, discontinuities, saturation, flatlines, motion, and annotations;
- whether event onsets are zero-based sample indices or seconds;
- planned preprocessing order, methods, parameters, exclusions, and outputs; and
- participant-level grouping needed to prevent leakage in later statistics.
Never infer units from a column name. Do not silently treat samples as milliseconds, volts, microsiemens, or arbitrary units.
Core workflow
1. Inspect before transforming
python skills/neurokit2/scripts/inspect_signal.py \
--input recording.csv --root . --deidentified \
--columns ECG,RSP,EDA --time-column time_s \
--units ECG=mV,RSP=a.u.,EDA=uS
The inspector is bounded and emits no row values or paths. Resolve non-monotonic time, duplicate samples, gaps, non-finite values, flat runs, and sampling-rate disagreement before filtering.
2. Preserve preprocessing order
Use this default reasoning order, adapting it to the acquisition and cited method:
- preserve immutable raw signal and annotations;
- verify time base, units, polarity, clipping, gaps, and artifacts;
- segment at long gaps; only interpolate short gaps under a declared policy;
- apply modality-specific cleaning at the native sampling rate;
- detect peaks/onsets or decompose components;
- inspect quality outputs and raw overlays;
- correct peaks only with logged categories and sensitivity checks;
- derive rates/features;
- align continuous modalities on a declared common time grid; and
- map event indices to that grid, epoch, baseline, and analyze.
…
常见问题
这里的“可重复”是什么意思?
意思是别人(或将来的你自己)可以按照完全相同的步骤操作,使用相同的数据得到相同的结果。
我可以用它来做医学诊断吗?
不可以。这个工具仅用于科研和教学,不应用于诊断、治疗或任何医疗决策。
它可以分析哪些类型的生理信号?
它适用于多种信号,例如 ECG(心电图)、EDA(皮肤电活动)、RSP(呼吸)等。
详情
作者的原始描述
Builds and audits reproducible NeuroKit2 research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Use when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
热度
- GitHub 星标
- 51k
- 排名
- #3504
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …