yobx.sklearn.decomposition.incremental_pca#

yobx.sklearn.decomposition.incremental_pca.sklearn_incremental_pca(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: IncrementalPCA, X: str, name: str = 'incremental_pca') str[source]#

Converts a sklearn.decomposition.IncrementalPCA into ONNX.

The transformation centres the data by subtracting the per-feature mean stored in mean_, projects onto the principal components, and optionally whitens the result when the estimator was fitted with whiten=True:

X  ──Sub(mean_)──►  centered  ──MatMul(components_.T)──►  projected
                                                                │
                                      whiten=True ──Div(√var_)──┘
                                                                │
                                                             output
Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • estimator – a fitted IncrementalPCA

  • outputs – desired output names (projected inputs)

  • X – input tensor name

  • name – prefix name for the added nodes

Returns:

output tensor name