Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4163387

Browse files
author
William de Vazelhes
committed
FIX: fix teh check that was making fail AffinityPropagation and remove the fit_intercept=False that should not be needed since scikit-learn#13279 is merged
1 parent 7eb9710 commit 4163387

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

sklearn/cluster/affinity_propagation_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def predict(self, X):
403403
raise ValueError("Predict method is not supported when "
404404
"affinity='precomputed'.")
405405

406-
if self.cluster_centers_.size > 0:
406+
if self.cluster_centers_.shape[0] > 0:
407407
return pairwise_distances_argmin(X, self.cluster_centers_)
408408
else:
409409
warnings.warn("This model does not have any cluster centers "

sklearn/linear_model/tests/__pycache__/tmp1ax1d_im

Whitespace-only changes.

sklearn/utils/estimator_checks.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,10 +2398,6 @@ def check_estimator_sparse_dense(name, estimator_orig):
23982398
estimator.__class__.__name__]
23992399
estimator.set_params(**params)
24002400
estimator_sp.set_params(**params)
2401-
# XXX should not be necessary:
2402-
if 'fit_intercept' in estimator.get_params():
2403-
estimator.set_params(fit_intercept=False)
2404-
estimator_sp.set_params(fit_intercept=False)
24052401
if isinstance(estimator, NeighborsBase):
24062402
estimator.set_params(algorithm='brute')
24072403
estimator_sp.set_params(algorithm='brute')

0 commit comments

Comments
 (0)