pub trait ExportOnnx {
// Required method
fn to_onnx(&self) -> Result<ModelProto>;
// Provided method
fn export_onnx(&self, path: impl AsRef<Path>) -> Result<()> { ... }
}Expand description
A model or pipeline that can be exported to ONNX.
Required Methods§
Sourcefn to_onnx(&self) -> Result<ModelProto>
fn to_onnx(&self) -> Result<ModelProto>
Build the ONNX graph for this object.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ExportOnnx for LinearRegression
onnx only.Export a fitted LinearRegression to an ONNX Gemm graph.
The canonical weights are read from smartcore’s own coefficient/intercept accessors, so this is independent of onnx-export’s smartcore version. Unlike the tree ensemble, the resulting graph runs in tract.
impl ExportOnnx for Pipeline
onnx only.Export the whole pipeline as one ONNX graph: each leading transformer that
can express itself as ONNX nodes (scalers as an affine map, imputers as a
Where(IsNaN, fill, x), one-hot encoders as a Gather/Equal/Concat
expansion) is spliced in front of the estimator’s graph, in order. A step
with no ONNX form is reported as an error naming it; the train-time balancer
is inference-irrelevant and skipped.
impl ExportOnnx for RandomForest
onnx only.Export a fitted RandomForest to an ONNX tree-ensemble classifier.
Uses onnx-export-rs’s serde-based compat adapter, so it is independent of the smartcore version onnx-export itself was built against.