Skip to content

⚠️ CI failed on Linux_Nightly.pylatest_pip_scipy_dev (last failure: May 17, 2025) ⚠️ #31370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scikit-learn-bot opened this issue May 16, 2025 · 4 comments

Comments

@scikit-learn-bot
Copy link
Contributor

scikit-learn-bot commented May 16, 2025

CI is still failing on Linux_Nightly.pylatest_pip_scipy_dev (May 17, 2025)

  • test_r_regression[True]
  • test_f_regression[csr_matrix]
@github-actions github-actions bot added the Needs Triage Issue requires triage label May 16, 2025
@lesteve lesteve removed the Needs Triage Issue requires triage label May 16, 2025
@lesteve
Copy link
Member

lesteve commented May 16, 2025

Looks like a change in scipy-dev

from scipy import sparse

m = sparse.csr_matrix([[1, 2, 3], [4, 5, 6]])
m.mean(axis=0)

scipy 1.15.2 is a numpy matrix

matrix([[2.5, 3.5, 4.5]])

scipy-dev is an numpy array

array([[2.5, 3.5, 4.5]])

Somehow we are relying on this in r_regression to flatten the result of X.mean(axis=0)

if center:
y = y - np.mean(y)
# TODO: for Scipy <= 1.10, `isspmatrix(X)` returns `True` for sparse arrays.
# Here, we check the output of the `.mean` operation that returns a `np.matrix`
# for sparse matrices while a `np.array` for dense and sparse arrays.
# We can reconsider using `isspmatrix` when the minimum version is
# SciPy >= 1.11
X_means = X.mean(axis=0)
X_means = X_means.getA1() if isinstance(X_means, np.matrix) else X_means
# Compute the scaled standard deviations via moments
X_norms = np.sqrt(row_norms(X.T, squared=True) - n_samples * X_means**2)
else:
X_norms = row_norms(X.T)
correlation_coefficient = safe_sparse_dot(y, X)
with np.errstate(divide="ignore", invalid="ignore"):
correlation_coefficient /= X_norms

@lesteve
Copy link
Member

lesteve commented May 16, 2025

It seems like this is linked to #22873, I commented scipy/scipy#22873 (comment) to ask about it there.

@scikit-learn-bot scikit-learn-bot changed the title ⚠️ CI failed on Linux_Nightly.pylatest_pip_scipy_dev (last failure: May 16, 2025) ⚠️ ⚠️ CI failed on Linux_Nightly.pylatest_pip_scipy_dev (last failure: May 17, 2025) ⚠️ May 17, 2025
@scikit-learn-bot
Copy link
Contributor Author

scikit-learn-bot commented May 18, 2025

CI is no longer failing! ✅

Successful run on May 19, 2025

@lesteve
Copy link
Member

lesteve commented May 19, 2025

Looks like it was fixed by scipy/scipy#23005, let's close this one!

@lesteve lesteve closed this as completed May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants