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 scalar and vector classification metric results
The frozen Evaluate source tree under /app/vendor/evaluate is used by an
offline classification evaluation workflow. Its F1, precision, and recall
adapters correctly delegate metric calculation to scikit-learn, but their
result adaptation assumes every backend return value exposes an array .size.
With the installed backend, averaged scores can be native scalar objects while
per-class scores are arrays.
Repair the existing source tree in place.
Requirements:
Update all three production modules:
vendor/evaluate/metrics/f1/f1.py,
vendor/evaluate/metrics/precision/precision.py, and
vendor/evaluate/metrics/recall/recall.py.
Preserve each scikit-learn backend call and its public arguments. This
includes labels, pos_label, average, sample_weight, and the existing
zero_division arguments where supported.
Return an ordinary Python float for scalar backend scores, including
native Python and NumPy scalar objects.
Preserve array results for average=None, including a one-element array
created by selecting a single label. Do not collapse per-class output and do
not replace it with a list.
Keep the metric classes, result keys (f1, precision, and recall),
feature declarations, smoke inputs, schema, runner, and all other vendored
files intact.
Compile the frozen source and run the supplied integration workflow to write
exactly /app/repair_report.json:
The report must conform to /app/output_schema.json and must be computed by
executing the repaired adapters. The verifier independently runs additional
binary, multiclass, multilabel, label-order, sample-weight, scalar-type,
one-label-vector, and zero-division regressions.