Skip to main content

AlgoBench Python SDK

AlgoBench 是一个算法基准测试分析工具,提供完整的统计分析和决策评估流水线。

安装

pip install algobench-sdk

快速开始

Python 库

from algobench import analyze

result = analyze("data.csv", baseline="V1", compare="V2", metrics=["HPWL", "runtime"])

print(result.decision.label)        # "建议上线"
print(result.decision.status)       # "yes"
print(result.statistics["HPWL"].mean_imp)  # 5.07
print(result.statistics["HPWL"].p_value)   # 6.13e-13

命令行

注意:Python SDK 作为库使用,命令行通过 python -m algobench 调用。 也可用 AlgoBench 单文件 CLI(node algobench-cli.js analyze ...)统一入口, 它会透传到 Python SDK。详见 CLI 文档。

# 完整分析
python -m algobench analyze data.csv -b V1 -c V2 -m HPWL,runtime

# 单指标统计
python -m algobench stats data.csv -b V1 -c V2 -m HPWL

# 数据质量检查
python -m algobench quality data.csv

# 数据诊断
python -m algobench diagnose data.csv

# CSV 格式验证
python -m algobench validate data.csv

CSV 数据格式

Case,Baseline/HPWL,New/HPWL,Baseline/runtime,New/runtime
case1,1200,1100,50,45
case2,800,750,30,28
  • 用例列:Case、Benchmark、Test、Instance 等
  • 指标列格式:算法名/指标名(使用 / 分隔符)
  • 元数据列:# 前缀(如 #Size)
  • 参数列:p_ 前缀(如 p_mode)

分析标准

模式 说明
exploratory 探索模式,识别更多潜在改进
standard 标准模式,平衡灵敏度和可靠性
strict 严格模式,用于发布或关键决策
result = analyze("data.csv", baseline="V1", compare="V2", criteria_id="strict")

决策状态

状态 含义
yes 建议上线
watch 观察期,需要更多数据
no 不建议上线
insufficient 数据不足

依赖

  • Python >= 3.10
  • numpy >= 1.24
  • scipy >= 1.10
  • pandas >= 2.0

许可证

AGPL-3.0-only

Metadata

Release files for algobench-sdk 2.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for algobench-sdk 2.0.13
File Size Uploaded Provenance Actions
algobench_sdk-2.0.13.tar.gz 43.9 kB With provenance Details for algobench_sdk-2.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for algobench-sdk 2.0.13
File Interpreter ABI Platform Actions
algobench_sdk-2.0.13-py3-none-any.whl Python 3 none any Details for algobench_sdk-2.0.13-py3-none-any.whl

Total release size: 99.2 kB

Release files / algobench_sdk-2.0.13.tar.gz

Download URL algobench_sdk-2.0.13.tar.gz
Size 43.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8dfa4d41d2d3b819c40c6d10fef873a2ae973c22c8000905c29627283a31f904
BLAKE2b-256 checksum
How to use checksums
3b62bd232d8a5accd562d38e249b6279460f14ccf4075bffc055840739186a4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / algobench_sdk-2.0.13-py3-none-any.whl

Download URL algobench_sdk-2.0.13-py3-none-any.whl
Size 55.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29906ef5fb7d9eaf77b5ba8d101b32b0d92c2d2e3dd0f6e395f4f812c3ad8c7b
BLAKE2b-256 checksum
How to use checksums
65074482c26cfd2d45b6ede99fe46937935d63d5305492b6ed0c64e0a0d94c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Security for algobench-sdk 2.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for algobench_sdk-2.0.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page