Metadata-Version: 2.4
Name: algobench-sdk
Version: 1.5.2
Summary: AlgoBench - 算法基准测试分析工具的 Python SDK 与 CLI
Author: DuanxiangLiu
License-Expression: AGPL-3.0-only
Project-URL: Homepage, https://github.com/DuanxiangLiu/AlgoBench
Project-URL: Documentation, https://duanxiangliu.github.io/AlgoBench-pages/
Project-URL: Repository, https://github.com/DuanxiangLiu/AlgoBench
Keywords: benchmark,statistics,analysis,decision,eda
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: pandas>=2.0

# AlgoBench Python SDK

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

## 安装

```bash
pip install algobench-sdk
```

## 快速开始

### Python 库

```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
```

### 命令行

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

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

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

# 数据诊断
algobench diagnose data.csv

# CSV 格式验证
algobench validate data.csv
```

## 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` | 严格模式，用于发布或关键决策 |

```python
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
