yobx.sklearn.impute.missing_indicator#

yobx.sklearn.impute.missing_indicator.sklearn_missing_indicator(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: MissingIndicator, X: str, name: str = 'missing_indicator') str[source]#

Converts a sklearn.impute.MissingIndicator into ONNX.

The transformer produces a boolean matrix that indicates which values are missing. When features='missing-only' (the default), only the columns that had at least one missing value during fit are returned; when features='all', every column is returned.

Graph structure when missing_values is numpy.nan (the default) and features='all':

X ──IsNaN──► mask [N, F]  ──► output

When features='missing-only', a Gather node selects only the columns recorded in estimator.features_:

X ──IsNaN──► mask [N, F]
                  │
features_ ────────┴──► Gather(axis=1) ──► output [N, len(features_)]

When missing_values is a numeric value the IsNaN node is replaced by an Equal node:

X ──Equal(missing_values)──► mask [N, F]
Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • estimator – a fitted MissingIndicator

  • outputs – desired output names

  • X – input name

  • name – prefix name for the added nodes

Returns:

output name