evaluation
agentic_ml.core.evaluation
¶
Generic trial evaluation.
This module has two roles:
- Parent side (:func:
evaluate_trial): serialize an evaluation request, run the child in an isolated subprocess via :mod:agentic_ml.core.sandbox, and parse the result. - Child side (
python -m agentic_ml.core.evaluation <in.json> <out.json>): the actual, task-agnostic scoring loop that imports the trial'sModel, runs cross-validatedfit/predictover the given partitions, computes metrics and checks the save/load roundtrip acceptance gate.
The parts that are task-specific (which metrics, how partitions are built, the roundtrip tolerance) are provided by the caller, so the runner itself is reused by every task.
EvaluationResult
dataclass
¶
EvaluationResult(
status: str,
metrics: dict[str, float | None],
runtime: float | None,
roundtrip_ok: bool,
error: str | None = None,
per_fold: list[dict[str, float]] = list(),
)
Aggregated outcome of evaluating a single trial.
evaluate_trial
¶
evaluate_trial(
trial_dir: str | Path,
dataset_path: str | Path,
metrics: list[str],
partitions: list[Partition],
tolerance: float,
timeout: float,
) -> EvaluationResult
Evaluate the trial in trial_dir and return an :class:EvaluationResult.
Source code in src/agentic_ml/core/evaluation.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |