yobx.sklearn.cross_decomposition.cca#

yobx.sklearn.cross_decomposition.cca.sklearn_cca(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: CCA, X: str, name: str = 'cca') str[source]#

Converts a sklearn.cross_decomposition.CCA into ONNX.

The conversion mirrors CCA.transform() with a single input X:

X ──Sub(_x_mean)──► centered ── Div(_x_std)──► scaled ──MatMul(x_rotations_) ──► output

The input is centred by subtracting _x_mean, normalized by dividing by _x_std, then projected using x_rotations_ to obtain the X canonical variates.

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

  • sts – shapes defined by scikit-learn

  • estimator – a fitted CCA

  • outputs – desired output names

  • X – input tensor name

  • name – prefix name for the added nodes

Returns:

output tensor name