Skip to main content

AlgoBench - 算法基准测试分析工具的 Python SDK 与 CLI

Project description

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
  • 用例列:CaseBenchmarkTestInstance
  • 指标列格式:算法名/指标名(使用 / 分隔符)
  • 元数据列:# 前缀(如 #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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algobench_sdk-2.0.1.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algobench_sdk-2.0.1-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file algobench_sdk-2.0.1.tar.gz.

File metadata

  • Download URL: algobench_sdk-2.0.1.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for algobench_sdk-2.0.1.tar.gz
Algorithm Hash digest
SHA256 eec044f40ed36276c44f8c20df29d23ae8a3e7b6915e8a7950631f961946b6a2
MD5 a7bef8ff79a78a2332e034fc659ef74d
BLAKE2b-256 bc34d432d2cdb917a82f7d5ae7dd74d47af4fa6c8d6dce05fb64f58d3cad141b

See more details on using hashes here.

Provenance

The following attestation bundles were made for algobench_sdk-2.0.1.tar.gz:

Publisher: publish-python.yml on DuanxiangLiu/AlgoBench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file algobench_sdk-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: algobench_sdk-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for algobench_sdk-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 35ee94d3412129e14d1d378ae57502fc70a4e957b51515f012bdcca16a57e399
MD5 bc27d3ea4f92bc84786b4df8decdf0b8
BLAKE2b-256 ada50dc4ee80d0e8a348c1b0e394a2e77c2f565d8660fdf63a7767179fb78d44

See more details on using hashes here.

Provenance

The following attestation bundles were made for algobench_sdk-2.0.1-py3-none-any.whl:

Publisher: publish-python.yml on DuanxiangLiu/AlgoBench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page