Skip to content

Commit

Permalink
Fixes for scikit-learn 0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed May 15, 2020
1 parent 6bfbf18 commit c52569d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions _unittests/ut_mlbatch/test_pipeline_cache.py
Expand Up @@ -19,12 +19,13 @@ def test_make_classification(self):
X, y = make_classification(random_state=42)

pipe0 = Pipeline([('pca', PCA(2)), ('lr', LogisticRegression())])
pars0 = pipe0._check_fit_params()

pipe = PipelineCache(
[('pca', PCA(2)), ('lr', LogisticRegression())], 'cache__')
pars1 = pipe._check_fit_params()
self.assertEqual(pars0, pars1)

if hasattr(pipe0, '_check_fit_params'):
pars0 = pipe0._check_fit_params() # pylint: disable=W0212,E1101
pars1 = pipe._check_fit_params() # pylint: disable=W0212,E1101
self.assertEqual(pars0, pars1)

pipe0.fit(X, y)
pipe.fit(X, y)
Expand Down
4 changes: 2 additions & 2 deletions _unittests/ut_sklapi/test_sklearn_stacking.py
Expand Up @@ -57,7 +57,7 @@ def test_pipeline_with_two_classifiers(self):
self.assertEqual(score, score2)
rp = repr(conv)
self.assertStartsWith(
'SkBaseTransformStacking([LogisticRegression(C=1.0, class_weight=None,', rp)
'SkBaseTransformStacking([LogisticRegression(', rp)

def test_pipeline_with_two_transforms(self):
data = load_iris()
Expand All @@ -74,7 +74,7 @@ def test_pipeline_with_two_transforms(self):
self.assertEqual(score, score2)
rp = repr(conv)
self.assertStartsWith(
"SkBaseTransformStacking([Normalizer(copy=True, norm='l2'),", rp)
"SkBaseTransformStacking([Normalizer(", rp)

def test_pipeline_with_params(self):
conv = SkBaseTransformStacking([LinearRegression(normalize=True),
Expand Down

0 comments on commit c52569d

Please sign in to comment.