Skip to content

Significant discrepancies between HistGradientBoostingRegressor scikit and ONNX output #1192

@khoover

Description

@khoover

When using skl2onnx for exporting pipelines using HistGradientBoostingRegressor, we are seeing significant discrepancies in the output (double-digit relative error on some inputs) even when we use the CastTransformer to float32-cast inputs to the regressor. For reference, our pipeline looks something like

Pipeline([
    ("preprocessor", ColumnTransformer([("categorical", TargetEncoder(), categorical_features), ("numeric", "passthrough", numeric_features)])),
    ("cast", CastTransformer(dtype=np.float32)),
    ("regressor", HistGradientBoostingRegressor())
])

My suspicion is that the way histogram-based gradient boosting generates buckets and decision thresholds requires the same float64->float32 threshold adjustment that the normal GradientBoostingRegressor gets, even when the inputs are float32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions