Skip to content

Commit

Permalink
keep n_init parameters for kmeans (#179)
Browse files Browse the repository at this point in the history
See
scikit-learn/scikit-learn@0d923da.
It's unclear how this change will affect the results, so keeping the
behavior is better.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz authored Aug 27, 2023
1 parent b3e8246 commit 5cb85d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mddatasetbuilder/datasetbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def _clusterdatas(cls, X, n_clusters, n_each=1):
min_max_scaler = preprocessing.MinMaxScaler()
X = np.array(min_max_scaler.fit_transform(X))
clus = MiniBatchKMeans(
n_clusters=n_clusters, init_size=(min(3 * n_clusters, len(X)))
n_clusters=n_clusters, init_size=(min(3 * n_clusters, len(X))), n_init=3
)
labels = clus.fit_predict(X)
choosedidx = []
Expand Down

0 comments on commit 5cb85d0

Please sign in to comment.