Skip to content

Commit cd48d6d

Browse files
committed
remove some more deprecation tests
1 parent acf7659 commit cd48d6d

File tree

4 files changed

+9
-25
lines changed

4 files changed

+9
-25
lines changed

sklearn/decomposition/tests/test_sparse_pca.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ def test_fit_transform(norm_comp):
7878
spca_lasso.fit(Y)
7979
assert_array_almost_equal(spca_lasso.components_, spca_lars.components_)
8080

81-
# Test that deprecated ridge_alpha parameter throws warning
82-
warning_msg = "The ridge_alpha parameter on transform()"
83-
assert_warns_message(DeprecationWarning, warning_msg, spca_lars.transform,
84-
Y, ridge_alpha=0.01)
85-
assert_warns_message(DeprecationWarning, warning_msg, spca_lars.transform,
86-
Y, ridge_alpha=None)
87-
8881

8982
@pytest.mark.filterwarnings("ignore:normalize_components")
9083
@pytest.mark.parametrize("norm_comp", [False, True])

sklearn/discriminant_analysis.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,6 @@ class QuadraticDiscriminantAnalysis(BaseEstimator, ClassifierMixin):
567567
568568
.. versionadded:: 0.17
569569
570-
store_covariances : boolean
571-
Deprecated, use `store_covariance`.
572-
573570
Attributes
574571
----------
575572
covariance_ : list of array-like, shape = [n_features, n_features]
@@ -602,8 +599,7 @@ class QuadraticDiscriminantAnalysis(BaseEstimator, ClassifierMixin):
602599
>>> clf.fit(X, y)
603600
... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
604601
QuadraticDiscriminantAnalysis(priors=None, reg_param=0.0,
605-
store_covariance=False,
606-
store_covariances=None, tol=0.0001)
602+
store_covariance=False, tol=0.0001)
607603
>>> print(clf.predict([[-0.8, -1]]))
608604
[1]
609605
@@ -653,8 +649,7 @@ def fit(self, X, y):
653649
self.priors_ = self.priors
654650

655651
cov = None
656-
store_covariance = self.store_covariance or self.store_covariances
657-
652+
store_covariance = self.store_covariance
658653
if store_covariance:
659654
cov = []
660655
means = []

sklearn/feature_extraction/tests/test_feature_hasher.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_feature_hasher_strings():
3333

3434
it = (x for x in raw_X) # iterable
3535

36-
h = FeatureHasher(n_features, non_negative=True, input_type="string")
36+
h = FeatureHasher(n_features, input_type="string")
3737
X = h.transform(it)
3838

3939
assert_equal(X.shape[0], len(raw_X))
@@ -120,11 +120,11 @@ def test_hasher_alternate_sign():
120120
input_type='string').fit_transform(X)
121121
assert Xt.data.min() < 0 and Xt.data.max() > 0
122122

123-
Xt = FeatureHasher(alternate_sign=True, non_negative=True,
123+
Xt = FeatureHasher(alternate_sign=True,
124124
input_type='string').fit_transform(X)
125125
assert Xt.data.min() > 0
126126

127-
Xt = FeatureHasher(alternate_sign=False, non_negative=True,
127+
Xt = FeatureHasher(alternate_sign=False,
128128
input_type='string').fit_transform(X)
129129
assert Xt.data.min() > 0
130130
Xt_2 = FeatureHasher(alternate_sign=False, non_negative=False,
@@ -144,11 +144,11 @@ def test_hash_collisions():
144144
# with an opposite sign and cancel out
145145
assert abs(Xt.data[0]) < len(X[0])
146146

147-
Xt = FeatureHasher(alternate_sign=True, non_negative=True,
147+
Xt = FeatureHasher(alternate_sign=True,
148148
n_features=1, input_type='string').fit_transform(X)
149149
assert abs(Xt.data[0]) < len(X[0])
150150

151-
Xt = FeatureHasher(alternate_sign=False, non_negative=True,
151+
Xt = FeatureHasher(alternate_sign=False,
152152
n_features=1, input_type='string').fit_transform(X)
153153
assert Xt.data[0] == len(X[0])
154154

@@ -159,12 +159,12 @@ def test_hasher_negative():
159159
Xt = FeatureHasher(alternate_sign=False, non_negative=False,
160160
input_type="pair").fit_transform(X)
161161
assert_true(Xt.data.min() < 0 and Xt.data.max() > 0)
162-
Xt = FeatureHasher(alternate_sign=False, non_negative=True,
162+
Xt = FeatureHasher(alternate_sign=False,
163163
input_type="pair").fit_transform(X)
164164
assert_true(Xt.data.min() > 0)
165165
Xt = FeatureHasher(alternate_sign=True, non_negative=False,
166166
input_type="pair").fit_transform(X)
167167
assert_true(Xt.data.min() < 0 and Xt.data.max() > 0)
168-
Xt = FeatureHasher(alternate_sign=True, non_negative=True,
168+
Xt = FeatureHasher(alternate_sign=True,
169169
input_type="pair").fit_transform(X)
170170
assert_true(Xt.data.min() > 0)

sklearn/metrics/tests/test_pairwise.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ def test_pairwise_distances():
8282
assert_equal(S.shape[0], X.shape[0])
8383
assert_equal(S.shape[1], Y.shape[0])
8484
assert_array_almost_equal(S, S2)
85-
# Using size_threshold argument should raise
86-
# a deprecation warning
87-
assert_warns(DeprecationWarning,
88-
manhattan_distances, X, Y, size_threshold=10)
8985
# Test cosine as a string metric versus cosine callable
9086
# The string "cosine" uses sklearn.metric,
9187
# while the function cosine is scipy.spatial

0 commit comments

Comments
 (0)