You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in https://github.com/scikit-learn/scikit-learn/pull/30878/files#r2142562746, our current stable_cumsum function brings very little value to the user: it does extra computation to check that np.allclose(np.sum(x), np.cumsum(x)[-1]) and raises a warning otherwise. However, in most cases, users can do nothing about the warning.
Furthermore, as seen in the CI of #30878, the array API compatible libraries we test against do not have the same numerical stability behavior for sum and cumsum, so it makes it challenging to write a test for the occurrence of this warning that is consistent across libraries.
So I would rather not waste the overhead of computing np.sum(x) and just always directly call np.cumsum or xp.cumsum and deprecate sklearn.utils.extmath.stable_cumsum.