[med-svn] [Git][med-team/q2-sample-classifier][master] refresh fix-autopkgtest.patch

Mohd Bilal (@rmb) gitlab at salsa.debian.org
Sat Sep 10 07:23:15 BST 2022



Mohd  Bilal pushed to branch master at Debian Med / q2-sample-classifier


Commits:
a4ffe821 by Mohammed Bilal at 2022-09-10T06:22:38+00:00
refresh fix-autopkgtest.patch

- - - - -


1 changed file:

- debian/patches/fix-autopkgtest.patch


Changes:

=====================================
debian/patches/fix-autopkgtest.patch
=====================================
@@ -2,35 +2,18 @@ Description: Fix autopkgtest errors that were failing due to sklearn changed API
 assignment of multi-dimensiondal array to pandas
 Author: Mohammed Bilal  <mdbilal at disroot.org>
 Last-Update: 2022-09-09
-diff --git a/q2_sample_classifier/tests/test_classifier.py b/q2_sample_classifier/tests/test_classifier.py
-index e17bbd9..c3b2c9c 100644
---- a/q2_sample_classifier/tests/test_classifier.py
-+++ b/q2_sample_classifier/tests/test_classifier.py
-@@ -57,8 +57,8 @@ class TestRFEExtractor(SampleClassifierTestPluginBase):
-         selector = RFECV(RandomForestClassifier(
-             random_state=123, n_estimators=2), step=steps, cv=10)
-         selector = selector.fit(self.X, self.y.ravel())
--        pdt.assert_series_equal(
--            _extract_rfe_scores(selector), expected)
-+        pdt.assert_index_equal(
-+            _extract_rfe_scores(selector).index, expected.index)
- 
-     def test_extract_rfe_scores_step_int_one(self):
-         self.extract_rfe_scores_template(1, self.exp1)
-diff --git a/q2_sample_classifier/utilities.py b/q2_sample_classifier/utilities.py
-index 6f57456..352e508 100644
 --- a/q2_sample_classifier/utilities.py
 +++ b/q2_sample_classifier/utilities.py
-@@ -253,7 +253,7 @@ def _extract_rfe_scores(rfecv):
+@@ -253,7 +253,7 @@
           for n in range(len(rfecv.grid_scores_)-1, -1, -1)]
      if x[0] < 1:
          x[0] = 1
 -    return pd.Series(rfecv.grid_scores_, index=x, name='Accuracy')
-+    return pd.Series(list(rfecv.grid_scores_), index=x, name='Accuracy')
++    return pd.Series(rfecv.cv_results_['mean_test_score'], index=x, name='Accuracy')
  
  
  def nested_cross_validation(table, metadata, cv, random_state, n_jobs,
-@@ -512,13 +512,13 @@ def _extract_estimator_parameters(estimator):
+@@ -512,13 +512,13 @@
      # (drop pipeline params and individual base estimators)
      estimator_params = {k: v for k, v in estimator.get_params().items() if
                          k.startswith('est__') and k != 'est__base_estimator'}
@@ -46,7 +29,7 @@ index 6f57456..352e508 100644
          rfep.savefig(join(output_dir, 'rfe_plot.png'))
          rfep.savefig(join(output_dir, 'rfe_plot.pdf'))
          plt.close('all')
-@@ -807,7 +807,7 @@ def _train_adaboost_base_estimator(table, metadata, column, n_estimators,
+@@ -807,7 +807,7 @@
      return Pipeline(
          [('dv', base_estimator.named_steps.dv),
           ('est', adaboost_estimator(base_estimator.named_steps.est,



View it on GitLab: https://salsa.debian.org/med-team/q2-sample-classifier/-/commit/a4ffe82155a6a30cd1db961e2bee5cba4b6671cf

-- 
View it on GitLab: https://salsa.debian.org/med-team/q2-sample-classifier/-/commit/a4ffe82155a6a30cd1db961e2bee5cba4b6671cf
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220910/9ff39b3d/attachment-0001.htm>


More information about the debian-med-commit mailing list