microsoft / hummingbird

Hummingbird compiles trained ML models into tensor computation for faster inference.
MIT License
3.36k stars 279 forks source link

FAILED tests/test_sklearn_bagging.py::TestSklearnBagging::test_bagging_logistic_regression - AssertionError #773

Open mshr-h opened 5 months ago

mshr-h commented 5 months ago

log: Build · microsoft/hummingbird@ae958a2

=========================== short test summary info ============================
FAILED tests/test_sklearn_bagging.py::TestSklearnBagging::test_bagging_logistic_regression - AssertionError: 
Not equal to tolerance rtol=1e-06, atol=1e-06

Mismatched elements: 200 / 200 (100%)
Max absolute difference: 0.99875297
Max relative difference: 0.99875297
 x: array([[9.809476e-01, 1.905245e-02],
       [9.987530e-01, 1.247026e-03],
       [8.200397e-01, 1.799603e-01],...
 y: array([[0., 1.],
       [0., 1.],
       [0., 1.],...
FAILED tests/test_sklearn_decomposition.py::TestSklearnCrossDecomposition::test_pca_converter_two - AssertionError: 
Not equal to tolerance rtol=1e-06, atol=2e-05

Mismatched elements: 8 / 8 (100%)
Max absolute difference: 3.00190626
Max relative difference: 0.89631042
 x: array([[ 0.260879,  0.153022],
       [ 0.606673,  0.456342],
       [ 6.468562,  6.489316],
       [11.763886, 12.001321]])
 y: array([[1.52568 , 1.475772],
       [2.433673, 2.35843 ],
       [6.256389, 6.266384],
       [8.884257, 8.999414]])
====== 2 failed, 387 passed, 275 skipped, 58 warnings in 82.84s (0:01:22) ======

cc: @ksaur @interesaaat

mshr-h commented 5 months ago

This is the latest ok log. Build · microsoft/hummingbird@d2aa5dc Seems like scikit-learn-1.5.0 is the problem.

mshr-h commented 5 months ago

According to the Version 1.5—scikit-learn 1.5.0 documentation, ensemble.BaggingClassifier and cross_decomposition.PLSRegression have changed something. Have those changes caused the errors?

Feature ensemble.BaggingClassifier and ensemble.BaggingRegressor now support metadata routing. The fit methods now accept **fit_params which are passed to the underlying estimators via their fit methods. #28432 by Adam Li and Benjamin Bossan.

Fix The coef_ fitted attribute of cross_decomposition.PLSRegression now takes into account both the scale of X and Y when scale=True. Note that the previous predicted values were not affected by this bug. #28612 by Guillaume Lemaitre.