nirs4all.pipeline.dagml.tuning_projection module

Projection helpers for native DAG-ML tuning outputs.

This module projects the internal ObjectiveTuningRunResult evidence tape into a public RunResult carrier. The default projection carries tuning evidence only. Callers may additionally project a refit winner prediction, but only by supplying the evaluation score and metric explicitly; this seam never computes or fabricates selection metrics.

nirs4all.pipeline.dagml.tuning_projection.project_objective_tuning_to_run_result(result: ObjectiveTuningRunResult, *, per_dataset: Mapping[str, Any] | None = None, winner_x: Any | None = None, winner_y_true: Any | None = None, winner_score: float | None = None, winner_metric: str | None = None, winner_sample_ids: Sequence[Any] | None = None, winner_dataset_name: str = 'tuning_winner', winner_model_name: str | None = None, winner_task_type: str = 'regression', winner_metadata: Mapping[str, Any] | None = None) → RunResult[source]

Return a RunResult carrying a native tuning result.

The returned object exposes tuning_result, tuning_id, tuning_best_params and tuning_best_value.

By default, the carrier contains zero prediction rows. When winner_x is supplied, the function calls the refit estimator’s predict method and inserts a single fold_id="final" prediction row. In that mode winner_score and winner_metric are required, because ranking evidence must come from an explicit external evaluation rather than this projection helper.