Skip to content

Commit 545cc80

Browse files
jjerphanMicky774
andauthored
MAINT Extend message for large sparse matrices support (#25961)
Co-authored-by: Meekail Zain <34613774+Micky774@users.noreply.github.com>
1 parent 01b9050 commit 545cc80

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sklearn/utils/tests/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def test_check_array_accept_large_sparse_raise_exception(X_64bit):
632632
# When large sparse are not allowed
633633
msg = (
634634
"Only sparse matrices with 32-bit integer indices "
635-
"are accepted. Got int64 indices."
635+
"are accepted. Got int64 indices. Please do report"
636636
)
637637
with pytest.raises(ValueError, match=msg):
638638
check_array(X_64bit, accept_sparse=True, accept_large_sparse=False)

sklearn/utils/validation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,11 @@ def _check_large_sparse(X, accept_large_sparse=False):
987987
indices_datatype = getattr(X, key).dtype
988988
if indices_datatype not in supported_indices:
989989
raise ValueError(
990-
"Only sparse matrices with 32-bit integer"
991-
" indices are accepted. Got %s indices." % indices_datatype
990+
"Only sparse matrices with 32-bit integer indices are accepted."
991+
f" Got {indices_datatype} indices. Please do report a minimal"
992+
" reproducer on scikit-learn issue tracker so that support for"
993+
" your use-case can be studied by maintainers. See:"
994+
" https://scikit-learn.org/dev/developers/minimal_reproducer.html"
992995
)
993996

994997

0 commit comments

Comments
 (0)