yobx.sklearn.decomposition.pca#
- yobx.sklearn.decomposition.pca.sklearn_pca(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: PCA, X: str, name: str = 'pca') str[source]#
Converts a
sklearn.decomposition.PCAinto ONNX.The transformation centres the data when the model was fitted with centering (i.e.
mean_is notNone) and then projects it onto the principal components:X ──Sub(mean_)──► centered ──MatMul(components_.T)──► output (if mean_ is not None)When
mean_isNonetheSubnode is skipped.- Parameters:
g – the graph builder to add nodes to
sts – shapes defined by scikit-learn
estimator – a fitted
PCAoutputs – desired output names (projected inputs)
X – input tensor name
name – prefix name for the added nodes
- Returns:
output tensor name