Skip to content

Commit

Permalink
Merge pull request #2073 from thocevar/kmeans
Browse files Browse the repository at this point in the history
[FIX] OWKMeans: Auto-commit fix and silhuette optimization
  • Loading branch information
lanzagar authored Mar 3, 2017
2 parents 05be958 + 0672cfa commit f025f83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Orange/clustering/kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def fit(self, X, Y=None):
proj.silhouette = np.nan
try:
if self._compute_silhouette and 2 <= proj.n_clusters < X.shape[0]:
proj.silhouette = silhouette_score(X, proj.labels_)
proj.silhouette = silhouette_score(X, proj.labels_, sample_size=5000)
except MemoryError: # Pairwise dist in silhouette fails for large data
pass
proj.inertia = proj.inertia_ / X.shape[0]
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/unsupervised/owkmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self):
layout = QGridLayout()
bg = gui.radioButtonsInBox(
self.controlArea, self, "optimize_k", orientation=layout,
box="Number of Clusters", callback=self.apply)
box="Number of Clusters", callback=self.invalidate)
layout.addWidget(
gui.appendRadioButton(bg, "Fixed:", addToLayout=False), 1, 1)
sb = gui.hBox(None, margin=0)
Expand Down

0 comments on commit f025f83

Please sign in to comment.