File size: 1,589 Bytes
5708f7d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | You are an agent, your current working directory is /app.
You can use the tools available to you to interact with the computer to assist the user in completing tasks.
# Repair the evaluation metric boundary
The workspace contains a frozen slice of a Hugging Face Evaluate repository
under `/app/vendor/project`. Its precision, recall, and F1 metric scripts call
scikit-learn and then normalize the returned score for downstream JSON
serialization. With current scikit-learn, binary averages can return a native
Python scalar while per-label (`average=None`) calls return an array. The
existing normalization assumes every result has the same array API.
Repair the existing metric modules so the integration runner works for every
case in `/app/cases.json` and for unseen case manifests supplied by the
verifier. Keep sklearn's metric values and options intact: binary and other
aggregate averages must serialize as a Python `float`, while `average=None`
must remain an ordered per-label array. Apply the compatibility boundary
consistently to `metrics/f1/f1.py`, `metrics/precision/precision.py`, and
`metrics/recall/recall.py`.
Run the integration command:
```sh
python3 /app/run_metrics.py --input /app/cases.json --output /app/output.json
```
The output must be exactly one JSON object with `schema_version`
`ml-eval-output.v1` and a `results` array in input order. Each row contains its
case `id` and `f1`, `precision`, and `recall` values (a number or an array).
Do not add dependencies, access the network, or replace the vendored metric
implementations with a new evaluator.
|