yobx.sklearn.covariance.graphical_lasso#
- yobx.sklearn.covariance.graphical_lasso.sklearn_graphical_lasso(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator, X: str, name: str = 'graphical_lasso') str[source]#
Converts a
sklearn.covariance.GraphicalLassoorsklearn.covariance.GraphicalLassoCVinto ONNX.Both estimators expose the same inference interface as
EmpiricalCovariance. The converter maps tomahalanobis(), returning the squared Mahalanobis distance from the fitted distribution for each observation:where
is
location_andis
precision_.Full graph structure:
X (N, F) │ └─ Sub(location_) ──► X_centered (N, F) │ ├─ MatMul(precision_) ──► X_prec (N, F) │ │ └──────────────────── Mul ──► X_prec_centered (N, F) │ ReduceSum(axis=1) ──► mahal_sq (N,) [output]- Parameters:
g – the graph builder to add nodes to
sts – shapes defined by scikit-learn
outputs – desired output names;
outputs[0]receives the squared Mahalanobis distancesestimator – a fitted
GraphicalLassoorGraphicalLassoCVX – input tensor name
name – prefix for added node names
- Returns:
output tensor name