yobx.sklearn.pipeline.pipeline#
- yobx.sklearn.pipeline.pipeline.sklearn_pipeline(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: Pipeline, X: str, name: str = 'pipeline', function_options: FunctionOptions | None = None) str | Tuple[str, ...][source]#
Converts a
sklearn.pipeline.Pipelineinto ONNX using registered converters for each step in the pipeline.The converter iterates over the pipeline steps and chains each step’s converter output into the next step’s input. Intermediate tensor names are generated with
GraphBuilder.unique_nameto avoid collisions.When
stscontains aFunctionOptionsunder the_FUNCTION_OPTIONS_KEYkey each step is exported as a separate ONNX local function instead of being inlined into the graph.- Parameters:
g – the graph builder to add nodes to
sts – shapes and types defined by scikit-learn; also carries an optional
FunctionOptionsvalue under the key_FUNCTION_OPTIONS_KEYoutputs – desired output tensor names for the pipeline result
estimator – a fitted
sklearn.pipeline.PipelineX – name of the input tensor to the pipeline
name – prefix used for names of nodes added for each pipeline step
function_options – to export every step as a local function
- Returns:
name of the output tensor, or a tuple of output tensor names