name: sklearn-pipelines-and-operators
description: "Decide supported sklearn operator, pipeline, data-layout, and
tree-strategy conversion tasks."
disable-model-invocation: true
metadata:
disco-role: operating
license: MIT
Sklearn pipelines and operators
Use this sub-skill when the task is to decide whether a scikit-learn estimator, transformer, or composite pipeline can be converted by Hummingbird, how to keep its input layout valid, or how to choose a tree conversion strategy.
Natural triggers include: supported sklearn operators, MissingConverter for a sklearn model, Pipeline, ColumnTransformer, FeatureUnion, pandas DataFrames, multiple inputs, OneHotEncoder strings, tree_implementation, tree_op_precision_dtype, and pipeline conversion parity.
Route first
Use this sub-skill for
- Checking whether every sklearn operator in a model or pipeline is in a supported family.
- Understanding parser-level composite wrappers such as
Pipeline, ColumnTransformer, FeatureUnion, model-selection wrappers, multi-output wrappers, bagging, and stacking.
- Choosing the output method family to validate after conversion:
transform, predict, predict_proba, decision_function, or score_samples.
- Keeping pandas, tuple/multiple-input, column-name, and string-feature layouts aligned between conversion and inference.
- Selecting and validating tree strategies:
"gemm", "perf_tree_trav", or "tree_trav", plus "float32"/"float64" tree precision.
Operating path
- Identify the concrete fitted sklearn classes and any wrappers around them.
- Check operator coverage. If a wrapper is supported but a child operator is not, the whole pipeline is not convertible without changing that child.
- For
Pipeline, ColumnTransformer, FeatureUnion, pandas, tuple inputs, or strings, use pipeline and data formats before writing conversion code.
- For tree models, decide whether to rely on Hummingbird's depth heuristic or set
extra_config explicitly, then validate the selected inference method on representative data.
- If conversion or parity fails, use troubleshooting and route backend-only issues to the sibling backend sub-skills.
Bundled references
- Operator coverage lists supported sklearn families, parser-level wrappers, output method families, and tree strategy knobs.
- Pipeline and data formats covers ColumnTransformer/FeatureUnion behavior, pandas and tuple inputs, names, and string handling.
- Troubleshooting maps common sklearn operator, pipeline, string, and tree-strategy failures to corrective actions.
No sub-skill-specific scripts are bundled for this area; use the references above and route generic conversion smokes to the core conversion sub-skill.