Skip to content
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

Fix tests that fail due to changes in sklearn 0.24.0 #1215

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

rachitk
Copy link

@rachitk rachitk commented Jul 1, 2021

What does this PR do?

Fixes the test (test_score_2 in tpot_tests.py) that was erroring on versions of sklearn >= 0.24.0 by adding a dictionary of scores for different sklearn versions. This was also done for test_score_3 - though that test didn't fail, the same method was implemented to make it easier to address the possibility of sklearn updates causing it to fail in the future. Versions from 0.22.0 onwards were included in the dict as this is the minimum version TPOT currently requires.

Where should the reviewer start?

Review tests/tpot_tests.py to see the changes made. No other changes were made in this PR.

How should this PR be tested?

Run the nosetests using TPOT on multiple versions of sklearn (all major releases between 0.22 and 0.24.2 were tested and included) and confirm that they all pass as expected.

Any background context you want to provide?

sklearn 0.24.0 introduced a change to KNeighborsClassifier (scikit-learn/scikit-learn#17038) that started causing the TPOT test for the known score of a pipeline including this classifier to fail. To make it easier to address this in the future while also supporting multiple versions of sklearn (rather than just the most recent), it would be useful if TPOT would check which sklearn version to use a known score from.

#1161 fixes a different test that was failing for similar reasons (changes in sklearn 0.24.0 moving an import).

What are the relevant issues?

This is one of the tests that #1175 (and many other PRs since) have failed despite making no changes to the functionality implemented by these functions.

The other failing test (due to an import in one_hot_encoder.py was previously addressed with #1161).

Screenshots (if appropriate)

N/A

Questions:

  • Do the docs need to be updated? No; nothing user-facing is changed. Only developers will be affected.
  • Does this PR add new (Python) dependencies? No.

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

Successfully merging this pull request may close these issues.

1 participant