Skip to content

Commit 1162038

Browse files
committed
feat(report): add smoke evaluation workflow
1 parent 693f9e0 commit 1162038

7 files changed

Lines changed: 121 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,16 @@ jobs:
3232
run: quorabust-serve --help
3333
- name: Report CLI
3434
run: quorabust-report --help
35+
- name: Smoke model report
36+
run: |
37+
quorabust-train \
38+
--csv examples/smoke_pairs.csv \
39+
--out /tmp/quorabust-smoke.pkl \
40+
--eval-fraction 0 \
41+
--seed 7
42+
quorabust-report \
43+
--model /tmp/quorabust-smoke.pkl \
44+
--artifact-label quorabust-smoke.pkl \
45+
--eval-csv examples/smoke_pairs.csv \
46+
--out /tmp/quorabust-smoke-model-card.md
47+
test -s /tmp/quorabust-smoke-model-card.md

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- `quorabust-report` for generating Markdown model cards from saved artifacts and
77
optional labeled holdout CSVs.
88
- `GET /models` serving endpoint for safe loaded-model metadata.
9+
- `examples/smoke_pairs.csv` and CI coverage for the train-to-report workflow.
910

1011
### Fixed
1112
- Capped NumPy below 2.5 so Mypy can parse dependency stubs with the configured

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ quorabust-report \
7373
The report includes artifact metadata, persisted training/eval metrics, optional holdout
7474
metrics, and a threshold confusion matrix. Use a real held-out CSV for comparable model
7575
claims; the command accepts the same `question1`, `question2`, `is_duplicate` column
76-
contract as training.
76+
contract as training. See [docs/REPORTING.md](docs/REPORTING.md) for the CI smoke
77+
workflow and real-evaluation checklist.
7778

7879
### Load a saved model
7980

docs/REPORTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Model Reporting
2+
3+
Use `quorabust-report` to turn a saved artifact into a Markdown model card. The report
4+
is meant for artifact review: it shows lineage, feature schema, persisted metrics, and
5+
optional holdout metrics with a threshold confusion matrix.
6+
7+
## Smoke Workflow
8+
9+
This repository includes `examples/smoke_pairs.csv` so the full train-to-report path can
10+
run in CI without the Kaggle dataset.
11+
12+
```bash
13+
quorabust-train \
14+
--csv examples/smoke_pairs.csv \
15+
--out /tmp/quorabust-smoke.pkl \
16+
--eval-fraction 0 \
17+
--seed 7
18+
19+
quorabust-report \
20+
--model /tmp/quorabust-smoke.pkl \
21+
--artifact-label quorabust-smoke.pkl \
22+
--eval-csv examples/smoke_pairs.csv \
23+
--out /tmp/quorabust-smoke-model-card.md
24+
```
25+
26+
The smoke dataset proves the command path works. It is not a benchmark and should not be
27+
used for public model-quality claims.
28+
29+
## Real Evaluation
30+
31+
For comparable numbers, generate the report from a held-out CSV that was not used for
32+
training:
33+
34+
```bash
35+
quorabust-train \
36+
--csv data/raw/train.csv \
37+
--out models/quorabust.pkl \
38+
--eval-fraction 0.1 \
39+
--seed 42
40+
41+
quorabust-report \
42+
--model models/quorabust.pkl \
43+
--artifact-label quorabust-tfidf-v1.pkl \
44+
--eval-csv data/processed/holdout.csv \
45+
--out reports/quorabust-tfidf-v1.md
46+
```
47+
48+
Record the dataset source, split method, command, commit SHA, and date next to any
49+
published result. Do not compare artifacts unless they use the same holdout split and
50+
threshold.

examples/smoke_pairs.csv

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
question1,question2,is_duplicate
2+
how do i learn python fast,what is the best way to learn python,1
3+
best way to study golang,how can i learn go programming,1
4+
what is docker used for,why do developers use docker,1
5+
how to deploy fastapi,steps to deploy a fastapi app,1
6+
what is prometheus monitoring,how does prometheus collect metrics,1
7+
how to improve postgres queries,ways to make postgres queries faster,1
8+
what is a websocket,how do websockets work,1
9+
how to write unit tests,what is the best way to test code,1
10+
what is terraform,why use terraform for infrastructure,1
11+
how to debug latency,how can i find slow requests,1
12+
what is xgboost,how does xgboost classification work,1
13+
how to clean text data,ways to preprocess text for ml,1
14+
what is the capital of france,how do i install redis,0
15+
best pizza in rome,how does kubernetes schedule pods,0
16+
how to learn python,what is the weather tomorrow,0
17+
postgres index tuning,best guitar strings for beginners,0
18+
what is a websocket,how do i bake sourdough bread,0
19+
fastapi deployment guide,what are symptoms of flu,0
20+
terraform state file,how to train for a marathon,0
21+
prometheus metrics,where can i buy train tickets,0
22+
docker compose network,what is the tallest mountain,0
23+
unit testing in python,how to grow tomatoes indoors,0
24+
machine learning model card,what is the price of gold,0
25+
text preprocessing pipeline,how to learn chess openings,0
26+
how do i cache api responses,ways to cache http api results,1
27+
what is rate limiting,how does api rate limiting work,1
28+
how to rotate logs,steps for application log rotation,1
29+
what is a health check,why services expose health endpoints,1
30+
how to tune xgboost,which xgboost parameters matter,1
31+
what is model drift,how do ml models drift over time,1
32+
redis cache invalidation,how to repair a bicycle chain,0
33+
openapi schema docs,what causes ocean tides,0

src/quorabust/report.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ def main(argv: list[str] | None = None) -> int:
217217
default=0.5,
218218
help="Decision threshold for the optional confusion matrix",
219219
)
220+
parser.add_argument(
221+
"--artifact-label",
222+
default=None,
223+
help="Public artifact label to print instead of the local model path",
224+
)
220225
parser.add_argument("--out", type=Path, default=None, help="Write Markdown here")
221226
args = parser.parse_args(argv)
222227

@@ -245,7 +250,7 @@ def main(argv: list[str] | None = None) -> int:
245250
return 1
246251

247252
card = render_model_card(
248-
artifact=str(args.model.resolve()),
253+
artifact=args.artifact_label or str(args.model.resolve()),
249254
meta=meta,
250255
holdout_metrics=holdout_metrics,
251256
)

tests/test_report.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,24 @@ def test_report_cli_writes_model_card(tmp_path):
6161
_df().to_csv(eval_csv, index=False)
6262
out = tmp_path / "MODEL_CARD.md"
6363

64-
assert main(["--model", str(model), "--eval-csv", str(eval_csv), "--out", str(out)]) == 0
64+
assert (
65+
main(
66+
[
67+
"--model",
68+
str(model),
69+
"--artifact-label",
70+
"smoke-model.pkl",
71+
"--eval-csv",
72+
str(eval_csv),
73+
"--out",
74+
str(out),
75+
]
76+
)
77+
== 0
78+
)
6579

6680
card = out.read_text(encoding="utf-8")
81+
assert "| artifact | smoke-model.pkl |" in card
6782
assert "## Holdout Evaluation" in card
6883
assert "## Confusion Matrix" in card
6984

0 commit comments

Comments
 (0)