mcpField
D
Disco

Disco

远程服务
leap-labs.com数据与分析73 周前更新

关于 Disco

Disco 面向分析人员和研究团队,可在不预设假设的情况下,从表格数据中发现模式。它会用留出数据验证模式、校正多重检验,并检索学术文献以提供背景和新颖性判断。

主要功能

  1. 01发现条件模式与特征交互
  2. 02在留出数据上验证模式
  3. 03对 p 值进行 FDR 校正
  4. 04将模式与学术文献比对
  5. 05返回效应、引文和新颖性标签

适用场景

  1. 01无预设假设地探索数据集
  2. 02识别影响结果的交互作用
  3. 03评估发现是否可能新颖
  4. 04查看经过验证且附有引文的模式

MCP 相关

Disco 提供地址为 https://disco.leap-labs.com/mcp 的 MCP 服务。其工具支持列出方案和估算、上传与分析数据、查询状态和结果,以及账户操作。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://disco.leap-labs.com/mcp
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

全部服务地址
Streamable HTTPhttps://disco.leap-labs.com/mcp需要授权

工具

14

此工具无需参数。

详细介绍

Disco

在表格数据中发现新颖且经统计验证的模式——人类和 Agent 容易忽略的特征交互、子群体效应和条件关系。

PyPI License: MIT

由 Leap Laboratories 打造。


它实际能做什么

大多数数据分析从一个问题开始。Disco 则从数据开始。

它不带偏见或假设,能找出显著改变目标列的特征条件组合,例如“45–65 岁、HDL 偏低且 CRP 偏高的患者,再入院率是其他患者的 3 倍”——你无需事先假设存在这种交互关系。

每种模式都经过:

  • 留出集验证——提高泛化的可能性
  • FDR 校正——包含 p 值,并针对多重检验进行调整
  • 学术文献核查——帮助你理解发现,并判断其是否新颖。

输出结构清晰:每种发现的模式都包含条件、效应量、p 值、引文和新颖性分类。

适用场景:“哪些变量对 X 最重要”“我们是否遗漏了某些模式”“我不知道该从这些数据入手做什么”“我需要了解 A 和 B 如何影响 C”。

**不适用于:**汇总统计、可视化、筛选、SQL 查询——这些请使用 pandas


快速入门

pip install discovery-engine-api

获取 API 密钥:

# Step 1: request verification code (no password, no card)
curl -X POST https://disco.leap-labs.com/api/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'

# Step 2: submit code from email → get key
curl -X POST https://disco.leap-labs.com/api/signup/verify \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "code": "123456"}'
# → {"key": "disco_...", "credits": 10, "tier": "free_tier"}

或者在 disco.leap-labs.com/developers 创建密钥。

运行首次分析:

from discovery import Engine

engine = Engine(api_key="disco_...")
result = await engine.discover(
    file="data.csv",
    target_column="outcome",
)

for pattern in result.patterns:
    if pattern.p_value < 0.05 and pattern.novelty_type == "novel":
        print(f"{pattern.description} (p={pattern.p_value:.4f})")

print(f"Explore: {result.report_url}")

运行需要几分钟。discover() 会自动轮询并记录进度——队列位置、预计等待时间、当前流水线步骤和预计完成时间。有关后台运行,请参阅异步运行。

→ Python SDK 完整参考 · 示例笔记本


你会获得什么

result.patterns 中的每个 Pattern 都如下所示(来自真实作物产量数据集的输出):

Pattern(
    description="When humidity is between 72–89% AND wind speed is below 12 km/h, "
                "crop yield increases by 34% above the dataset average",
    conditions=[
        {"type": "continuous", "feature": "humidity_pct",
         "min_value": 72.0, "max_value": 89.0},
        {"type": "continuous", "feature": "wind_speed_kmh",
         "min_value": 0.0, "max_value": 12.0},
    ],
    p_value=0.003,              # FDR-corrected
    novelty_type="novel",
    novelty_explanation="Published studies examine humidity and wind speed as independent "
                        "predictors, but this interaction effect — where low wind amplifies "
                        "the benefit of high humidity within a specific range — has not been "
                        "reported in the literature.",
    citations=[
        {"title": "Effects of relative humidity on cereal crop productivity",
         "authors": ["Zhang, L.", "Wang, H."], "year": "2021",
         "journal": "Journal of Agricultural Science"},
    ],
    target_change_direction="max",
    abs_target_change=0.34,     # 34% increase
    support_count=847,          # rows matching this pattern
    support_percentage=16.9,
)

值得注意的几点:

  • 模式是多个条件的组合——例如湿度和风速同时满足条件,而不只是“湿度越高越好”
  • 明确的阈值——72–89%,而不是模糊的相关性
  • 新颖或验证性——每种模式都会分类;验证性模式用于验证已知科学结论,新颖模式则是你真正要寻找的
  • 引文——展示已知信息,让你看清哪些发现确实是新的
  • report_url 链接到交互式网页报告,其中可视化展示了所有模式

result.summary 提供由大模型生成的叙述式概览:

result.summary.overview
# "Disco identified 14 statistically significant patterns. 5 are novel.
#  The strongest driver is a previously unreported interaction between humidity
#  and wind speed at specific thresholds."

result.summary.key_insights
# ["Humidity × low wind speed at 72–89% humidity produces a 34% yield increase — novel.",
#  "Soil nitrogen above 45 mg/kg shows diminishing returns when phosphorus is below 12 mg/kg.",
#  ...]

工作原理

Disco 是一条流水线,而不是对数据进行提示词工程。它会:

  1. 使用你数据的一个子集训练机器学习模型
  2. 使用可解释性技术提取模型学到的模式
  3. 使用 FDR 校正(Benjamini-Hochberg)在留出数据上验证每种模式
  4. 通过语义搜索,针对学术文献核查通过验证的模式

你无法通过编写 pandas 代码或让大模型查看 CSV 来复现这一过程。Disco 能找到基于假设的分析会遗漏的结构,因为它并非从假设出发。


准备数据

运行前,请排除会产生无意义发现的列。Disco 会发现统计上真实存在的模式,但如果输入中包含与目标存在定义性关联的列,这些模式就会变成同义反复。

排除:

  1. 标识符 — 行 ID、UUID、患者 ID、样本代码
  2. 数据泄漏 — 重命名或重新格式化后的目标(例如,目标是 diagnosis_code 时的 diagnosis_text)
  3. 同义反复列 — 与目标表示同一构念的其他编码。如果目标是 serious,那么 serious_outcome、not_serious、death 都属于同一分类。如果目标是 profit,那么 revenue 和 cost 合起来就构成了它。如果目标是调查指数,那么各个子项就会构成同义反复。

查看包含示例的完整指南:SKILL.md


参数

await engine.discover(
    file="data.csv",           # path, Path, or pd.DataFrame
    target_column="outcome",   # column to predict/explain
    analysis_depth=2,          # 2=default, higher=deeper analysis, lower = faster and cheaper
    visibility="public",       # "public" (always free, data and report is published) or "private" (costs credits)
    column_descriptions={      # improves pattern explanations and literature context
        "bmi": "Body mass index",
        "hdl": "HDL cholesterol in mg/dL",
    },
    excluded_columns=["id", "timestamp"],  # see "Preparing your data" above
    use_llms=False,                        # Defaults to False. If True, runs are slower and more expensive, but you get smarter pre-processing, summary page, literature context and novelty assessment. Public runs always use LLMs.
    title="My dataset",
    description="...", # improves pattern explanations and literature context
)

公共运行免费,但结果会公开发布。对于私有数据,请设置 visibility="private" — 这会消耗积分。


异步运行

运行需要几分钟。对于 Agent 工作流或需要并行处理其他工作的脚本:

# Submit without waiting
run = await engine.run_async(file="data.csv", target_column="outcome", wait=False)
print(f"Submitted {run.run_id}, continuing...")

# ... do other things ...

result = await engine.wait_for_completion(run.run_id, timeout=1800)

对于同步脚本和 Jupyter 笔记本:

result = engine.run(file="data.csv", target_column="outcome", wait=True)
# or: pip install discovery-engine-api[jupyter] for notebook compatibility

MCP 服务

Disco 可作为 MCP 服务使用 — 无需本地安装。

{
  "mcpServers": {
    "discovery-engine": {
      "url": "https://disco.leap-labs.com/mcp",
      "env": { "DISCOVERY_API_KEY": "disco_..." }
    }
  }
}

工具:discovery_list_plans、discovery_estimate、discovery_upload、discovery_analyze、discovery_status、discovery_get_results、discovery_account、discovery_signup、discovery_signup_verify、discovery_login、discovery_login_verify、discovery_add_payment_method、discovery_subscribe、discovery_purchase_credits。

→ 完整的 Agent 技能文件


定价

费用
公共运行免费 — 结果和数据会公开发布
私有运行积分因文件大小和配置而异 — 使用 engine.estimate()
免费套餐每月 10 积分,无需银行卡
Researcher$49/月 — 500 积分
Team$199/月 — 2000 积分
积分每积分 $0.10

运行前进行估算:

estimate = await engine.estimate(file_size_mb=10.5, num_columns=25, analysis_depth=2, visibility="private")
# estimate["cost"]["credits"] → 55
# estimate["account"]["sufficient"] → True/False

账户管理完全支持编程操作 — 可通过 SDK 或 REST API 添加付款方式、订阅套餐和购买积分。请参阅 Python SDK 参考 或 SKILL.md。


预期数据格式

Disco 需要扁平表格 — 列表示特征,行表示样本。

| patient_id | age | bmi  | smoker | outcome |
|------------|-----|------|--------|---------|
| 001        | 52  | 28.3 | yes    | 1       |
| 002        | 34  | 22.1 | no     | 0       |
| ...        | ... | ...  | ...    | ...     |
  • 每条观测占一行 — 例如患者、样本、交易、测量值等
  • 每个特征占一列 — 数值、类别、日期时间或自由文本均可
  • 一列目标 — 你想要了解的结果。必须至少有 2 个不同值。
  • 允许缺失值 — Disco 会自动处理。请勿预先删除行或填补缺失值。
  • 无需透视 — 如果数据已经是扁平表格,就可以直接使用

**支持的格式:**CSV、TSV、Excel(.xlsx)、JSON、Parquet、ARFF、Feather。最大 5 GB。

**不支持:**图像、原始文本文件、嵌套/分层 JSON、多工作表 Excel(请使用第一个工作表或导出为 CSV)


与其他工具相比

目标工具
汇总统计、数据质量ydata-profiling、sweetviz
预测模型AutoML(auto-sklearn、TPOT、H2O)
快速查看相关性pandas、seaborn
回答关于数据的具体问题ChatGPT、Claude
发现你不知道该寻找什么Disco

Disco 并非 EDA 或 AutoML 的替代品 — 它能发现那些工具会遗漏的模式。我们在一个已知真实模式的数据集上测试了 18 种数据分析工具。大多数工具都自信地报告了错误结果。只有 Disco 找到了所有模式。


链接


评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。