8000 fixes in GMM, TSNE, MDS, LSHForest · scikit-learn/scikit-learn@c8473fc · GitHub
[go: up one dir, main page]

Skip to content

Commit c8473fc

Browse files
committed
fixes in GMM, TSNE, MDS, LSHForest
1 parent e3e0827 commit c8473fc

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

sklearn/manifold/mds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def __init__(self, n_components=2, metric=True, n_init=4,
357357
def _pairwise(self):
358358
return self.kernel == "precomputed"
359359

360-
def fit(self, X, init=None, y=None):
360+
def fit(self, X, y=None, init=None):
361361
"""
362362
Computes the position of the points in the embedding space
363363
@@ -374,7 +374,7 @@ def fit(self, X, init=None, y=None):
374374
self.fit_transform(X, init=init)
375375
return self
376376

377-
def fit_transform(self, X, init=None, y=None):
377+
def fit_transform(self, X, y=None, init=None):
378378
"""
379379
Fit the data from X, and returns the embedded coordinates
380380

sklearn/manifold/t_sne.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def _tsne(self, P, alpha, n_samples, random_state, X_embedded=None):
507507

508508
return X_embedded
509509

510-
def fit_transform(self, X):
510+
def fit_transform(self, X, y=None):
511511
"""Transform X to the embedded space.
512512
513513
P 8000 arameters

sklearn/mixture/gmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def score_samples(self, X):
321321
responsibilities = np.exp(lpr - logprob[:, np.newaxis])
322322
return logprob, responsibilities
323323

324-
def score(self, X):
324+
def score(self, X, y=None):
325325
"""Compute the log probability under the model.
326326
327327
Parameters
@@ -411,7 +411,7 @@ def sample(self, n_samples=1, random_state=None):
411411
num_comp_in_X, random_state=random_state).T
412412
return X
413413

414-
def fit(self, X):
414+
def fit(self, X, y=None):
415415
"""Estimate model parameters with the expectation-maximization
416416
algorithm.
417417

sklearn/neighbors/approximate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def radius_neighbors(self, X, radius=None, return_distance=True):
483483
else:
484484
return _array_of_arrays(neighbors)
485485

486-
def partial_fit(self, X):
486+
def partial_fit(self, X, y=None):
487487
"""
488488
Inserts new data into the already fitted LSH Forest.
489489
Cost is proportional to new total size, so additions

sklearn/svm/classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ def __init__(self, kernel='rbf', degree=3, gamma=0.0, coef0=0.0, tol=1e-3,
910910
shrinking, False, cache_size, None, verbose, max_iter,
911911
random_state)
912912

913-
def fit(self, X, sample_weight=None, **params):
913+
def fit(self, X, y=None, sample_weight=None, **params):
914914
"""
915915
Detects the soft boundary of the set of samples X.
916916

sklearn/utils/estimator_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ def check_pipeline_consistency(name, Estimator):
256256
X -= X.min()
257257
y = multioutput_estimator_convert_y_2d(name, y)
258258
estimator = Estimator()
259-
pipeline = make_pipeline(estimator)
260259
set_fast_parameters(estimator)
261260
set_random_state(estimator)
261+
pipeline = make_pipeline(estimator)
262262
estimator.fit(X, y)
263263
pipeline.fit(X, y)
264264
funcs = ["score", "fit_transform"]

0 commit comments

Comments
 (0)
0