8000 Enforce partial_fit taking an optional y. · scikit-learn/scikit-learn@6632043 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6632043

Browse files
committed
Enforce partial_fit taking an optional y.
1 parent f02335a commit 6632043

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

doc/whats_new.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ Enhancements
173173
- Parallelized calculation of :func:`pairwise_distances` is now supported
174174
for scipy metrics and custom callables. By `Joel Nothman`_.
175175

176-
- Allow the use of all clustering algorithms in :class:`pipeline.Pipeline`.
177-
By `Andreas Müller`_.
176+
- Allow the fitting and scoring of all clustering algorithms in
177+
:class:`pipeline.Pipeline`. By `Andreas Müller`_.
178178

179179
Documentation improvements
180180
..........................

sklearn/decomposition/incremental_pca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def fit(self, X, y=None):
174174
self.partial_fit(X[batch])
175175
return self
176176

177-
def partial_fit(self, X):
177+
def partial_fit(self, X, y=None):
178178
"""Incremental fit with X. All of X is processed as a single batch.
179179
180180
Parameters

sklearn/neural_network/rbm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def gibbs(self, v):
217217

218218
return v_
219219

220-
def partial_fit(self, X):
220+
def partial_fit(self, X, y=None):
221221
"""Fit the model to the data X which should contain a partial
222222
segment of the data.
223223
@@ -301,7 +301,7 @@ def score_samples(self, X):
301301
returns the log of the logistic function of the difference.
302302
"""
303303
check_is_fitted(self, "components_")
304-
304+
305305
v = check_array(X, accept_sparse='csr')
306306
rng = check_random_state(self.random_state)
307307

sklearn/utils/estimator_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def check_fit_score_takes_y(name, Estimator):
253253
estimator = Estimator()
254254
set_fast_parameters(estimator)
255255
set_random_state(estimator)
256-
funcs = ["fit", "score"]
256+
funcs = ["fit", "score", "partial_fit"]
257257

258258
for func_name in funcs:
259259
func = getattr(estimator, func_name, None)

0 commit comments

Comments
 (0)
0