Evaluate on your data
Score a checkpoint on your own labeled test set with valen.evaluate and read the per-question predictions and aggregate metrics.
Use the same independent test before and after fine-tuning.
Keep candidates, order, temperature, media budgets and backend fixed. Select settings on validation before inspecting test results.
python -m valen.evaluate --checkpoint output/domain/run/latest \
--data test.jsonl --output output/evaluation
Outputs are per-question predictions.jsonl and aggregate metrics.json. Report sample counts, failures and per-class results; training loss cannot replace test performance. See the complete Cookbook comparison.
Metrics
Let y be the label distribution and p the predicted distribution. The implementation is in question_metrics / summarize.
| Metric | Applies to | Definition |
|---|---|---|
nll | All labeled questions | -sum(y[k] * log(p[k])), using the natural log |
brier | All labeled questions | sum((p[k] - y[k])²), not divided by the number of candidates |
accuracy | Strict one-hot labels | 1 when the predicted argmax equals the label argmax; Score is also judged on discrete grades |
expected_score_mae | Score, including soft labels | abs(sum(k*p[k]) - sum(k*y[k])) |
rps | Score, including soft labels | Mean of the squared differences between the first K−1 cumulative distributions |
macro_f1 | Noul hard labels | Arithmetic mean of the true and false F1 scores; a class's F1 is 0 when its denominator is 0 |
Aggregates are equal-weight averages over questions. metric_counts gives the number of valid questions for each metric; soft labels do not count toward accuracy, so its denominator usually differs from questions. The Noul confusion matrix and macro_f1 only appear in the task/noul and task_modality/noul/* groups.
Group keys include overall, task/*, modality/*, task_modality/*/*, language/* and domain/*. Modality comes from meta.modality when present; otherwise there are only two categories, text and media, with no automatic distinction between images and video.
See probabilities and thresholds and backend measurements. The CLI defaults to T=1 and accepts a versioned --calibration with --protocol; it reports raw and calibrated metrics from one forward pass. --cache-role, --group-namespace and the protocol file save an offline calibration cache. See calibration and automation. Exact timing and aggregation are defined in evaluate.py.