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

Test suite does not build with scikit-learn 1.2.1 #187

Closed
tillea opened this issue Jan 31, 2023 · 2 comments · Fixed by #201
Closed

Test suite does not build with scikit-learn 1.2.1 #187

tillea opened this issue Jan 31, 2023 · 2 comments · Fixed by #201

Comments

@tillea
Copy link

tillea commented Jan 31, 2023

Bug Description
Debian has moved to scikit-learn 1.2.1. When I try to build the q2-feature-classifier package against this I get test suite errors.

Steps to reproduce the behavior
Try building with scikit-learn 1.2.1. In the Debian CI you can find a build log which ends with:

Name                                                       Stmts   Miss  Cover
------------------------------------------------------------------------------
q2_feature_classifier/__init__.py                              8      0   100%
q2_feature_classifier/_blast.py                               54      0   100%
q2_feature_classifier/_consensus_assignment.py                43      0   100%
q2_feature_classifier/_cutter.py                             100      2    98%
q2_feature_classifier/_skl.py                                 58     36    38%
q2_feature_classifier/_taxonomic_classifier.py                71     38    46%
q2_feature_classifier/_version.py                              4      0   100%
q2_feature_classifier/_vsearch.py                             91     26    71%
q2_feature_classifier/classifier.py                          195     88    55%
q2_feature_classifier/custom.py                               64     40    38%
q2_feature_classifier/plugin_setup.py                          4      0   100%
q2_feature_classifier/tests/__init__.py                       19      6    68%
q2_feature_classifier/tests/test_classifier.py               147    114    22%
q2_feature_classifier/tests/test_consensus_assignment.py     178     15    92%
q2_feature_classifier/tests/test_custom.py                    40     14    65%
q2_feature_classifier/tests/test_cutter.py                    67      0   100%
q2_feature_classifier/tests/test_taxonomic_classifier.py      77     43    44%
------------------------------------------------------------------------------
TOTAL                                                       1220    422    65%
=========================== short test summary info ============================
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_autotune_reads_per_batch - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range'      parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_autotune_reads_per_batch_ceil - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_autotune_reads_per_batch_disable_if_single_job - sklearn.utils._param_validation.InvalidParameterError:  The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_autotune_reads_per_batch_more_jobs_than_reads - sklearn.utils._param_validation.InvalidParameterError:   The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_autotune_reads_per_batch_zero_jobs - sklearn.utils._param_validation.InvalidParameterError: The          'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_class_weight - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter of     HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_classify - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter of         HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_fit_classifier - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter of   HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_fit_specific_classifiers - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range'      parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_pipeline_serialisation - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range'        parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_populate_class_weight - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range'         parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_classifier.py::ClassifierTests::test_unassigned_taxa - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter of  HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_consensus_assignment.py::HybridClassiferTests::test_classify_hybrid_vsearch_sklearn_all_exact_match - sklearn.utils._param_validation.        InvalidParameterError: The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_consensus_assignment.py::HybridClassiferTests::test_classify_hybrid_vsearch_sklearn_mixed_query - sklearn.utils._param_validation.            InvalidParameterError: The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_custom.py::CustomTests::test_chunked_hashing_vectorizer - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter  of HashingVectorizer must be an instance of 'tuple'. Got [8, 8] instead.
FAILED q2_feature_classifier/tests/test_custom.py::CustomTests::test_low_memory_multinomial_nb - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range' parameter   of HashingVectorizer must be an instance of 'tuple'. Got [8, 8] instead.
FAILED q2_feature_classifier/tests/test_taxonomic_classifier.py::TestFormats::test_taxonomic_classifier_dir_fmt - sklearn.utils._param_validation.InvalidParameterError: The          'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_taxonomic_classifier.py::TestTransformers::test_old_dirfmt - sklearn.utils._param_validation.InvalidParameterError: The 'ngram_range'         parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_taxonomic_classifier.py::TestTransformers::test_old_sklearn_version - sklearn.utils._param_validation.InvalidParameterError: The              'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_taxonomic_classifier.py::TestTransformers::test_taxo_class_dir_fmt_to_taxo_class_result - sklearn.utils._param_validation.                    InvalidParameterError: The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
FAILED q2_feature_classifier/tests/test_taxonomic_classifier.py::TestTransformers::test_taxo_class_result_to_taxo_class_dir_fmt - sklearn.utils._param_validation.                    InvalidParameterError: The 'ngram_range' parameter of HashingVectorizer must be an instance of 'tuple'. Got [7, 7] instead.
================= 21 failed, 40 passed, 138 warnings in 51.37s =================

All these errors contain sklearn.*

Expected behavior
Tests are working also with latest version of sklearn.

Computation Environment

  • OS: Debian unstable
  • QIIME 2 Release: 2022.11.1

Kind regards, Andreas.

@tillea
Copy link
Author

tillea commented Feb 2, 2023

Thanks to Étienne Mollier there is a patch for this issue.

@ebolyen
Copy link
Member

ebolyen commented Feb 17, 2023

Thanks @tillea! We're not in a good position to update scikit-learn right this moment, but we're going to try to get scikit-learn updated by our April release (I've added this issue to that project).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Development
Development

Successfully merging a pull request may close this issue.

2 participants