yobx.sklearn.preprocessing.min_max_scaler#

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

Converts a sklearn.preprocessing.MinMaxScaler into ONNX.

The transformation is decomposed into two mandatory steps mirroring sklearn_standard_scaler():

X  ──Sub(data_min_)──►  shifted  ──Div(data_range_)──►  normalized

followed by an optional rescaling to the requested feature_range:

normalized  ──Mul(feature_width)──►  scaled  ──Add(feature_min)──►  output
             (if feature_range != (0, 1))

When feature_range is the default (0, 1) the last two nodes are replaced by a single Identity.

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

  • sts – shapes defined by scikit-learn

  • estimator – a fitted MinMaxScaler

  • outputs – desired output names

  • X – input name

  • name – prefix name for the added nodes

Returns:

output name