nirs4all.pipeline.dagml.methods_lane module
Callback-free DAG-ML lane for pipelines of generic n4m role steps.
A generator-free or model-parameter-sweep pipeline whose steps are all
n4m.roles estimators runs through DAG-ML’s native Methods estimator
controllers (dag_ml._dag_ml.run_cv_refit_methods_in_process). DAG-ML
compiles and schedules exactly the campaign of the host-callback lane — same
fold set, envelope views, variant SELECT, FIT_CV, REFIT and scoring — while
every node fits, transforms and predicts inside libn4m. Python only lowers the
steps to n4m:<method_id> nodes, supplies the identity-keyed numeric rows
once, and rebuilds the captured REFIT pipeline from the N4ME states for the
existing joblib artifact contract.
native_methods_refusal() is the complete eligibility rule. A pipeline
it refuses keeps the host-callback lane unchanged; the chosen lane is recorded
on the result as per_dataset[...]["execution_lane"].
- nirs4all.pipeline.dagml.methods_lane.lane_record(lane: str, reason: str | None = None) dict[str, Any][source]
The provenance record of the lane one campaign ran on.
- nirs4all.pipeline.dagml.methods_lane.merge_lane_records(records: list[dict[str, Any]]) dict[str, Any][source]
One record for a result assembled from several campaigns.
- nirs4all.pipeline.dagml.methods_lane.native_methods_refusal(steps: list[Any], spectro: Any, *, identity: Any, excluded: set[int] | None = None) str | None[source]
Return why
stepscannot run on the native Methods lane, orNone.stepsare the splitter-free, model-parameter-applied steps of one DAG campaign. The native lane takes them when:N4A_DAGML_NATIVE_METHODSdoes not disable it, the in-process DAG-ML mechanism is selected and the installed extension exposes the native Methods CV/REFIT lane;the dataset is one single-source 2D block with no augmented rows, no repetition grouping, no held-out test partition and no sample excluded in the OOF universe;
every step before the model is an
n4m.rolestransformer or selector and the last step is{"model": <n4m.roles regressor or classifier>}(optionally withname) — a classifier exactly for a classification task, which then has one integral class column;no method requires a fit input a DAG node cannot supply (sample weights, groups, feature groups, blocks, spectral axis, target domain, fold ids) or retains training rows in its fitted state;
every parameter has an exact native value (integral
int, finitedouble), and a parameter sweep only produces exact native values: a_range_over anintparameter has integral bounds and step, and a_log_range_sweeps adoubleparameter.
Anything else keeps the host-callback lane.
- nirs4all.pipeline.dagml.methods_lane.native_params(estimator: Any) dict[str, Any][source]
Typed native parameter values of an n4m role estimator.
Noneleaves the native default, as the n4m Python binding does. A value without an exact native representation raisesValueError.
- nirs4all.pipeline.dagml.methods_lane.record_execution_lane(result: Any, record: Mapping[str, Any]) None[source]
Record the lane on every dataset entry of
result.
- nirs4all.pipeline.dagml.methods_lane.result_lane_record(result: Any) dict[str, Any][source]
The lane record of a single-campaign-family result.
DAG runs outside the lowered concrete and parameter-sweep paths execute their operators through the host callback, so an unrecorded entry is a host-callback run.
- nirs4all.pipeline.dagml.methods_lane.run_cv_refit_lane(*, steps: list[Any], dsl: dict[str, Any], envelope: dict[str, Any], spectro: Any, identity: Any, excluded: set[int] | None, selection_metric: str, refit: bool, refit_top_k: int, run_callback: Callable[[], dict[str, Any]]) dict[str, Any][source]
Run one CV+REFIT campaign on the native Methods lane when eligible.
run_callbackruns the unchanged host-callback campaign. Both lanes return the same outcome shape plus anexecution_lanerecord; neither retries the other.