Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TST make sure to not have ties in sparse callable NN test #27567

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

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Oct 11, 2023

Fixing the issue seen in scipy-dev. This is due to ties in the distance and a change of behaviour due to: numpy/numpy#24201

I change the test to not have any tie because this is not the purpose of the test itself.

Close #27423

/usr/share/miniconda/envs/testvenv/lib/python3.11/site-packages/pandas/core/internals/blocks.py:534: FutureWarning
___________________ test_sparse_metric_callable[csr_matrix] ____________________
[gw1] linux -- Python 3.11.4 /usr/share/miniconda/envs/testvenv/bin/python

csr_container = <class 'scipy.sparse._csr.csr_matrix'>

    @pytest.mark.parametrize("csr_container", CSR_CONTAINERS)
    def test_sparse_metric_callable(csr_container):
        def sparse_metric(x, y):  # Metric accepting sparse matrix input (only)
            assert issparse(x) and issparse(y)
            return x.dot(y.T).toarray().item()
       [2, 1]]))
func       = <function assert_array_compare at 0x7f8ae6b65d00>
kwds       = {'err_msg': '', 'header': 'Arrays are not equal', 'strict': False, 'verbose': True}
self       = <contextlib._GeneratorContextManager object at 0x7f8ae6ba1810>

@github-actions
Copy link

github-actions bot commented Oct 11, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: a307455. Link to the linter CI: here

@lesteve lesteve enabled auto-merge (squash) October 11, 2023 13:55
@lesteve
Copy link
Member

lesteve commented Oct 11, 2023

Setting auto-merge, thanks!

@lesteve lesteve merged commit 30b7847 into scikit-learn:main Oct 11, 2023
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Oct 31, 2023
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⚠️ CI failed on Linux_Nightly.pylatest_pip_scipy_dev ⚠️
3 participants