yobx.sklearn.preprocessing.standard_scaler#

yobx.sklearn.preprocessing.standard_scaler.sklearn_standard_scaler(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: StandardScaler, X: str, name: str = 'scaler') str[source]#

Converts a sklearn.preprocessing.StandardScaler into ONNX.

The implementation respects the with_mean and with_std flags:

X  ──Sub(mean)──►  centered  ──Div(scale)──►  output
     (if with_mean)               (if with_std)

When with_mean=False the Sub node is skipped; when with_std=False the Div node is replaced by an Identity.

Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • estimator – a fitted StandardScaler

  • outputs – desired names (scaled inputs)

  • X – inputs

  • name – prefix name for the added nodes

Returns:

output