nirs4all.pipeline.dagml.training_compiler module
Prepared DAG-ML training-contract compiler for the native estimator.
P3-R0 deliberately does not lower arbitrary nirs4all pipeline syntax yet. It
closes the next safe seam: an already-built DAG-ML training contract bundle can
be injected into DagMLPipelineEstimator
through a small compiler object, with fit identity diagnostics added in one
place before the native binding call.
- class nirs4all.pipeline.dagml.training_compiler.DagMLPreparedTrainingContracts(request: Any, data_envelopes: Mapping[str, Any], relations: Any, training_influence: Any, op_callback: Callable[[Any], Any] | None, outcome_id: str, run_id: str, bundle_id: str, warnings: Sequence[str] = (), diagnostics: Mapping[str, Any] | None = None, methods_inputs: Mapping[str, Any] | None = None, methods_library_path: str | None = None)[source]
Bases:
objectOpaque DAG-ML training contracts already prepared by a trusted builder.
The fields map one-to-one to
DagMLTrainingExecutionand ultimately todag_ml.execute_training(...). This type performs only seam-level validation: object identity, required text ids, callback callability, and diagnostics normalization. DAG-ML remains the authority for graph, relation, envelope, scoring, and influence semantics.
- class nirs4all.pipeline.dagml.training_compiler.DagMLTrainingContractFactoryCompiler(factory: ~collections.abc.Callable[[...], ~nirs4all.pipeline.dagml.training_compiler.DagMLPreparedTrainingContracts], include_fit_identity_diagnostics: bool = True, additional_diagnostics: ~collections.abc.Mapping[str, ~typing.Any] = <factory>)[source]
Bases:
objectCompiler adapter around a callable that builds prepared contracts.
This is the intended handoff point for P3-R1 lowerers: the lowerer owns pipeline syntax, dataset envelopes, relations, influence, and callbacks; the shared seam below still validates and annotates the resulting native contract before the estimator calls DAG-ML.
- compile_fit(estimator: DagMLPipelineEstimator, X: Any, y: Any, *, sample_ids: Any = None, groups: Any = None, metadata: Any = None, identity_frame: DagMLFitIdentityFrame) DagMLTrainingExecution[source]
Build, validate and package contracts for one estimator
fitcall.
- factory: Callable[[...], DagMLPreparedTrainingContracts]
- class nirs4all.pipeline.dagml.training_compiler.DagMLTrainingRequestCompiler(contracts: DagMLTrainingRequestContracts, include_fit_identity_diagnostics: bool = True, additional_diagnostics: Mapping[str, ~typing.Any]=<factory>, dagml_module: str | None = None)[source]
Bases:
objectCompiler adapter for a request-spec plus executable DAG-ML contracts.
- compile_fit(estimator: DagMLPipelineEstimator, X: Any, y: Any, *, sample_ids: Any = None, groups: Any = None, metadata: Any = None, identity_frame: DagMLFitIdentityFrame) DagMLTrainingExecution[source]
Assemble a signed request and return native execution inputs.
- contracts: DagMLTrainingRequestContracts
- class nirs4all.pipeline.dagml.training_compiler.DagMLTrainingRequestContracts(request_spec: DagMLTrainingRequestSpec, data_envelopes: Mapping[str, Any], relations: Any, training_influence: Any, op_callback: Callable[[Any], Any] | None, outcome_id: str, run_id: str, bundle_id: str, warnings: Sequence[str] = (), diagnostics: Mapping[str, Any] | None = None, methods_inputs: Mapping[str, Any] | None = None, methods_library_path: str | None = None)[source]
Bases:
objectExecutable contract bundle whose request still needs local assembly.
- request_spec: DagMLTrainingRequestSpec
- to_prepared() DagMLPreparedTrainingContracts[source]
Assemble the signed request and return prepared execution contracts.
- class nirs4all.pipeline.dagml.training_compiler.PreparedDagMLTrainingCompiler(contracts: DagMLPreparedTrainingContracts, include_fit_identity_diagnostics: bool = True, additional_diagnostics: Mapping[str, ~typing.Any]=<factory>)[source]
Bases:
objectCompiler adapter for pre-built DAG-ML training contracts.
- compile_fit(estimator: DagMLPipelineEstimator, X: Any, y: Any, *, sample_ids: Any = None, groups: Any = None, metadata: Any = None, identity_frame: DagMLFitIdentityFrame) DagMLTrainingExecution[source]
Return native execution inputs for one estimator
fitcall.
- contracts: DagMLPreparedTrainingContracts
- nirs4all.pipeline.dagml.training_compiler.compile_prepared_training_contracts(contracts: DagMLPreparedTrainingContracts, *, identity_frame: DagMLFitIdentityFrame, include_fit_identity_diagnostics: bool = True, additional_diagnostics: Mapping[str, Any] | None = None) DagMLTrainingExecution[source]
Validate and package prepared DAG-ML training contracts for execution.