Skip to content

Commit 905dedc

Browse files
glemaitreNicolasHug
authored andcommitted
DEP remove random_state from OneClassSVM (scikit-learn#13802)
1 parent 19192c0 commit 905dedc

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

sklearn/svm/classes.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,13 +1128,6 @@ class OneClassSVM(BaseLibSVM, OutlierMixin):
11281128
max_iter : int, optional (default=-1)
11291129
Hard limit on iterations within solver, or -1 for no limit.
11301130
1131-
random_state : int, RandomState instance or None, optional (default=None)
1132-
Ignored.
1133-
1134-
.. deprecated:: 0.20
1135-
``random_state`` has been deprecated in 0.20 and will be removed in
1136-
0.22.
1137-
11381131
Attributes
11391132
----------
11401133
support_ : array-like, shape = [n_SV]
@@ -1168,12 +1161,12 @@ class OneClassSVM(BaseLibSVM, OutlierMixin):
11681161

11691162
def __init__(self, kernel='rbf', degree=3, gamma='auto_deprecated',
11701163
coef0=0.0, tol=1e-3, nu=0.5, shrinking=True, cache_size=200,
1171-
verbose=False, max_iter=-1, random_state=None):
1164+
verbose=False, max_iter=-1):
11721165

11731166
super().__init__(
11741167
kernel, degree, gamma, coef0, tol, 0., nu, 0.,
11751168
shrinking, False, cache_size, None, verbose, max_iter,
1176-
random_state)
1169+
random_state=None)
11771170

11781171
def fit(self, X, y=None, sample_weight=None, **params):
11791172
"""
@@ -1201,11 +1194,6 @@ def fit(self, X, y=None, sample_weight=None, **params):
12011194
If X is not a C-ordered contiguous array it is copied.
12021195
12031196
"""
1204-
1205-
if self.random_state is not None:
1206-
warnings.warn("The random_state parameter is deprecated and will"
1207-
" be removed in version 0.22.", DeprecationWarning)
1208-
12091197
super().fit(X, np.ones(_num_samples(X)),
12101198
sample_weight=sample_weight, **params)
12111199
self.offset_ = -self._intercept_

0 commit comments

Comments
 (0)